How to remove Broken Link Checker widget from admin menu

The problem is probably just that your code runs before broken links checker adds the meta box. Try changing the action line to this: if(is_admin()){ add_action(‘wp_dashboard_setup’, ‘remove_dashboard_widgets’, 1000 ); } EDIT To be a little more clear, the particular issue here is that the add_action() function is running super early compared to Broken Link Checker’s … Read more

WordPress Widget multiple use

You need to implement your Widget using the Widgets API, so that WordPress knows how to make multiple instances of the Widget. Your Widget declaration should take the following format: class My_Widget extends WP_Widget { function My_Widget() { // widget actual processes } function form($instance) { // outputs the options form on admin } function … Read more

wordpress widget textbox in the sidebar

check your sidebar.php and functions.php of the theme, the sidebar define the markup outside the widget; the function register_sidebar() defines the markup before content of the widgets; this markup you must change. See the codex for this function: codex register_sidebar() Edit Specifically, you need to look at the before_widget and after_widget parameters of the register_sidebar() … Read more

Use wp_enqueue_style based on user option in widget

This is sort of sloppy as the style will still be enqueued regardless. In the code to display your widget, change the CSS selectors based on whether or not the user selected own style: <?php $prefix = $instance[‘own_style’] ? ‘ownstyle_’ : ‘pluginstyle_’; //then…. ?> <div id=”<?php echo $prefix; ?>selector”> …</div> etc A user would be … Read more

Widget queries even when there are no sidebars?

Does unregistering them the also disable the database queries? Goes in functions.php: //Unregister all Default Widgets function unregister_default_wp_widgets() { unregister_widget(‘WP_Widget_Pages’); unregister_widget(‘WP_Widget_Calendar’); unregister_widget(‘WP_Widget_Archives’); unregister_widget(‘WP_Widget_Links’); unregister_widget(‘WP_Widget_Meta’); unregister_widget(‘WP_Widget_Search’); unregister_widget(‘WP_Widget_Text’); unregister_widget(‘WP_Widget_Categories’); unregister_widget(‘WP_Widget_Recent_Posts’); unregister_widget(‘WP_Widget_Recent_Comments’); unregister_widget(‘WP_Widget_RSS’); unregister_widget(‘WP_Widget_Tag_Cloud’); } add_action(‘widgets_init’, ‘unregister_default_wp_widgets’, 1);