Are you looking for a way to adding or removing items to the favorites menu in the header? While there’s probably a plugin for this, we have created a quick code snippet that you can use to customize the favorites dropdown menu in WordPress.
Instructions:
All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:
function custom_favorite_menu($actions) { # Removing # unset($actions['edit-comments.php']); unset($actions['media-new.php']); # Adding # $actions['admin.php?your-plugin'] = array('Your Plugin', 'manage_options'); return $actions; } add_filter('favorite_actions', 'custom_favorite_menu');
Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste code snippets in WordPress, so you don’t accidentally break your site.
If you liked this code snippet, please consider checking out our other articles on the site like: 11 best WordPress plugins for writers and how to start a blog.
Comments Leave a Reply