Error with Custom Admin Screen in iframe Thickbox

Interesting question. Investigating it, I’ve found a [wp-hackers] thread by the same Dion Hulse which gives a bit more of information. First, a testing page with a simple link which will open another admin page in a thickbox. add_action(‘admin_menu’, ‘wpse_71437_admin_submenu’); function wpse_71437_admin_submenu() { add_menu_page( ‘TB’, ‘<span style=”color:#e57300;”>Thickbox</span>’, ‘edit_pages’, ‘open_hidden_page_in_thickbox’, ‘wpse_71437_submenu_page’, ”, // no icon 1 … Read more

Adding custom code into header.php using a plugin

Specifically, I’d like to create a plugin to echo the following in the header immediately after the default stylesheet The preferred way is to enqueue it, with the default/main stylesheet as the dependency. Here’s a demo plugin, with the structure: + plugins/ | +–+ my-ie-style/ | +–+ my-ie-style.php | +–+ css/ | +–+ ie.css where … Read more

How do I handle multiple Submit buttons in plugin’s option page?

The settings API is crap. I need a long time and need try many until I got this working. My problem was that the values from my inputs never was passed to the validate callback. I end up in using the array method: <input type=”text” name=”foo[bar]” value=”baz” /> If the formular will be send, in … Read more

How does uninstalling WordPress plugins work?

As explained in my comment in the Question, the error is certainly in how the DROP TABLE is being performed. But answering to How does uninstalling WordPress plugins work?: If we do a register_uninstall_hook in our plugin, the callback is stored in the option uninstall_plugins in /wp-includes/plugin.php. $uninstallable_plugins[plugin_basename($file)] = $callback; update_option(‘uninstall_plugins’, $uninstallable_plugins); In the PHPDoc … Read more

Determine which theme location a wp_get_nav_menu_items is for

Not sure this is the simplest means, but you could conditionally add the filter to just the location you want to modify via wp_nav_menu_args filter when wp_nav_menu is called, then immediately remove the filter so it isn’t applied to other menus. function wpa108544_nav_menu_args( $args ){ // check if it’s the location we want the filter … Read more

Custom theme sufficient or custom plugin neccessary for this feature set?

WordPress will not automatically provide these features. From what you are describing, you will want to create custom post types, a taxonomy or two for classification and custom fields for the post types. You COULD build all of this into a WordPress theme but the generally advised approach is to wrap your functionality into one … Read more

In a plugin, why is add_action(‘init’) not executed before the plugin is activated?

WordPress is an application and everything that is run within that application is called by hooks. Then 2 main hook functions are add_action and add_filter, but as you saw, register_activation_hook and register_deactivation_hook are other functions that are used in the context of activation and deactivation. There exist more hook defining functions, like functions that will … Read more