Tag Info

New answers tagged

1

This actually seems like a quite plausible approach - to me. There is nothing wrong with looping through it, sometimes it is the only/fastest way anyway. I don't know how you get your sidebars, but for this $sidebars_widgets = get_option( 'sidebars_widgets' ); can be used. Which gives you an associative array containing a list of widgets per sidebar ...


0

You can't. If you're using the settings API correctly, here's what happens when you try to save your options: Form posts to options.php WordPress handles $_POST and runs update_option on your registered settings Your sanitize callback from register_setting is applied Any data that fails/you don't return in your callback isn't saved WordPress redirects ...


1

Look at the last argument to add_menu_page()-- $position. $position (integer) (optional) The position in the menu order this menu should appear. By default, if this parameter is omitted, the menu will appear at the bottom of the menu structure. The higher the number, the lower its position in the menu. WARNING: if two menu items use the same ...


0

Basically, if you do not want to create your own network admin settings page, you will need to use both hooks mentioned separately in the other two answers: add_filter( 'wpmu_options' , 'show_my_network_settings' ); add_action( 'update_wpmu_options', 'save_my_network_settings' ); function save_network_settings() { // checkbox example if( isset( ...


0

function optionExists($option_name) { global $wpdb; $row = $wpdb->get_row($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", $option_name)); if (is_object($row)) { return true; } return false; }



Top 50 recent answers are included