Custom dashboard widget search box

The following will do, although it redirects to the Posts listing page /wp-admin/edit.php… Also included, search boxes for Pages and CPTs. Code /** * PLEASE NOTE THAT THE FOLLOWING CODE DOESN’T HAVE ANY SANITIZATION or NONCE methods */ add_action(‘wp_dashboard_setup’, ‘wpse_58520_dashboard_search_widget’); function wpse_58520_dashboard_search_widget() { wp_add_dashboard_widget( ‘wpse_54742_active_site_plugins’, __( ‘Search Posts/Pages/CPTs’ ), ‘wpse_58520_make_dashboard_search_widget’ ); } function wpse_58520_make_dashboard_search_widget() { … Read more

Can I use a form in a dashboard widget?

There are two options to use forms in a dashboard widget: Use the parameter control_callback. See the Codex wp_add_dashboard_widget( ‘my_id’, // $widget_id ‘my_name’, // $widget_name ‘my_render_widget’, // $callback ‘my_control’ // $control_callback ); function my_control() { // print some form elements, WordPress will handle the <form> tag. } If you want to use a form in … Read more

Hide widgets/plugins from dashboard

WordPress SEO If you want to remove the admin menu: you can do that with: function hide_wpseo() { remove_action(‘admin_menu’, ‘zeo_options_menu’); } add_action( ‘init’, ‘hide_wpseo’); where it will be removed for all users. WordPress SEO by Yoast To hide the admin menu: and the admin menu bar: one can use: function hide_yoastseo() { remove_action(‘admin_bar_menu’, ‘wpseo_admin_bar_menu’,95); remove_menu_page(‘wpseo_dashboard’); … Read more

Prevent /wp-admin/ from redirecting to homepage?

In my case, it ended up being some kind of adverse interaction in the nginx wordpress config that I had. Something about not passing along the naked arguments: location / { original line: try_files $uri @php; new line: try_files $uri $uri/ /index.php?$args; } And the associated upstream was wrong. Used the config suggested here: https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/ … Read more

Show Welcome Panel on Dashboard for every user

This is how I solved it: In functions.php // Custom Dashboard function my_custom_dashboard() { $screen = get_current_screen(); if( $screen->base == ‘dashboard’ ) { include ‘admin/dashboard-panel.php’; } } add_action(‘admin_notices’, ‘my_custom_dashboard’); dashboard-panel.php <!– Hide Old Wrap with CSS –> <style type=”text/css”> div#wpcontent div.wrap { display: none; } div#wpcontent div.my-dashboard { display: block; } </style> <!– New Wrap … Read more

Replace dashboard widgets with banner ad

Check this reference http://www.wpbeginner.com/wp-themes/how-to-add-custom-dashboard-widgets-in-wordpress/ for adding dashboard widget Remove Widgets in Dashboard for removing dashboard widget add_action(‘wp_dashboard_setup’, ‘example_remove_dashboard_widgets’ ); function example_remove_dashboard_widgets() { remove_meta_box( ‘dashboard_quick_press’, ‘dashboard’, ‘side’ ); remove_meta_box( ‘dashboard_recent_drafts’, ‘dashboard’, ‘side’ ); remove_meta_box( ‘dashboard_primary’, ‘dashboard’, ‘side’ ); remove_meta_box( ‘dashboard_secondary’, ‘dashboard’, ‘side’ ); remove_meta_box( ‘dashboard_browser_nag’, ‘dashboard’, ‘normal’ ); remove_meta_box( ‘dashboard_right_now’, ‘dashboard’, ‘normal’ ); remove_meta_box( ‘dashboard_recent_comments’, ‘dashboard’, … Read more

Browser loading content from Twitter in admin area?

What happens when you try it with all your plugins disabled? What happens when you try is with the default WP theme? What happens when you try it with a different browser that has no browser extensions or add-ins installed? What happens when you set twitter.com -> 127.0.0.1 as suggested?