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

How can I save repeatable fields with one value inside an array?

You are saving only one image and one image caption. Your loop in dsslider_manager_save_extras function loops throught global $custom_meta_fields defined in php file. Not through $_POST variable. Your loop should look something like this: foreach ( $_POST[‘fields’] as $field ) { … } In HTML, the form should look like this <input type=”hidden” name=”fields[$field[ID]]” value=””/> … 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

Saving Plugin settings to the database

I would store the array to the options able as a serialized value. update_option(‘dw_quotes’, serialize($quotes)); and retrieve with: $quotes = get_option(‘dw_quotes’, null); if ($quotes !== null) { $quotes = unserialize($quotes); } Other things to consider: Add handling in case the quotes option does not exist. Also add handling to delete quotes from the option table … Read more