How to use the ‘Quick edit’ option only for Admin and Editor in ‘All posts’ on the Dashboard?

Use a conditional depending on capability. Admin’s and Editors can both moderate comments so we can use the moderate_comments capability. If a user cannot moderate comments, then remove the quick edit link. Then we can filter post_row_actions to remove the quick edit link. function remove_quick_edit(){ function unset_quick_edit( $actions ) { unset( $actions[‘inline hide-if-no-js’] ); return … Read more

Is there a way to remove plugins in dashboard – where you cannot identify the slug by the plugins name?

I think what you’ll want to do is iterate over the $_GLOBALS[‘menu’] array. This should give you a list of all the items in the admin menu so you know what the hooks are that need to be removed. There are more details and good information in this answer: https://wordpress.stackexchange.com/a/136064/9080 The appropriate hook/slug can be … Read more

How can I move Customizer menu item to first level in WP Dashboard?

The function below should help you. It removes the default menu item from the “Apperance” menu item and a new menu item to the Dashboard. add_action( ‘admin_menu’, ‘fb_customize_admin_menu_hide’, 999 ); function fb_customize_admin_menu_hide(){ global $submenu; // Remove Appearance – Customize Menu unset( $submenu[ ‘themes.php’ ][ 6 ] ); // Create URL. $customize_url = add_query_arg( ‘return’, urlencode( … Read more

Warning: call_user_func() expects parameter 1 to be a valid callback, function

I just found the solution. use this code instead public function register_voguepay_woocommerce_payouts_dashboard_widget(){ add_meta_box( ‘withdraw_to_bank’, ‘Withdraw to Bank’, array($this, ‘voguepay_woocommerce_payouts_dashboard_widget_display’), ‘dashboard’, ‘side’, ‘high’ ); } public function voguepay_woocommerce_payouts_dashboard_widget_display(){ echo “Hello World, I’m a great Dashboard Widget”; }

How to hide some categories in dashboard

You could hook to the get_terms_args filter conditionally depending on your user/role Something along those lines add_filter( ‘get_terms_args’, ‘restrict_cat’, 10, 2 ); function restrict_cat( $args, $taxonomies ){ // Don’t run if we are not dealing with categories if( ‘category’ != $taxonomies[0] ) return $args; // The check for the user we want to restrict // … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)