Blogging software: WordPress: Difference between revisions

From Elvanör's Technical Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:


* If you use register_setting to update some plugin options on the back office, be very careful. All options get updated all the time even if you did not specify a form field for them, and validation is basically nowhere (the sanitize_callback thing is a joke: there's no documentation about it, so no way of knowing how it works).
* If you use register_setting to update some plugin options on the back office, be very careful. All options get updated all the time even if you did not specify a form field for them, and validation is basically nowhere (the sanitize_callback thing is a joke: there's no documentation about it, so no way of knowing how it works).
== Options ==
* Use '''update_option''' if you want the option updated regardless of the existence of a previous value; use '''add_option''' if you only want to change the option if it does not exist before.

Revision as of 22:15, 9 April 2010

Creating a new Article

  • Don't copy via Firefox the contents of an old post; this results in a broken layout. The best way is to edit the old post you want to copy, and copy its HTML code directly.

Plugin Development

  • Although WordPress is great, the plugin development framework is totally broken. It is possible to do whatever you need to do, but the code is 100% ugly and there is no real way of getting your stuff done in a beautiful way. This is just spaghetti PHP code as its worst, a tons of stuff hacked together without any general visions.

General remarks

  • If you use register_setting to update some plugin options on the back office, be very careful. All options get updated all the time even if you did not specify a form field for them, and validation is basically nowhere (the sanitize_callback thing is a joke: there's no documentation about it, so no way of knowing how it works).

Options

  • Use update_option if you want the option updated regardless of the existence of a previous value; use add_option if you only want to change the option if it does not exist before.