Show WordPress Plugin Menu(Admin) To Editor

Check these links below. This is where the permissions are being set for your pretty link plugin admin menu: pretty-link/prli-main.php -> line 16 – it’s set to administrator you want edit_posts pretty-link/prli-main.php -> line 160 – it’s set to $current_user->user_level >= 8 you want $current_user->user_level >= 7 What are your options? OPTION 1 – Change … Read more

How do I disable certain menu in editor user administrator page

Put this code in your current active theme’s functions.php file function remove_editor_menus() { global $menu; global $current_user; get_currentuserinfo(); if($current_user->user_level < 10) { $restricted = array(__(‘Pages’), __(‘Media’), __(‘Comments’), __(‘Tools’), ); end ($menu); while (prev($menu)){ $value = explode(‘ ‘,$menu[key($menu)][0]); if(in_array($value[0] != NULL?$value[0]:”” , $restricted)){unset($menu[key($menu)]);} }// end while }// end if } add_action(‘admin_menu’, ‘remove_editor_menus’);

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

Margin problem on management menu?

You can’t modify WordPress’ admin CSS. Well, technically you could, but it’d just get overridden the next time you update WordPress. The solution to this is to add your own custom CSS file to override the parts you wish to. In your theme’s functions.php, you can add a new CSS file to be loaded only … Read more

in_array function Problem

I’d assume that $specific_admin_usernames is an array– so there’s no need for this line $specific_admin_usernames_imploded = implode($master_admin_usernames); Also your if statement is a little backwards. PHP’s in_array( $needle, $haystack) doesn’t need the $current_logged_in_user !== part. Try: if ( in_array($current_logged_in_user, $master_admin_usernames) ){ // this runs when the current user is IN the master list }

Change users.php WP_User_Query

pre_get_users is the action that is fired before a user query is run. You need to check the context of the action to make sure you’re on the main users screen. You can then alter the query with any parameters accepted by WP_User_Query. A quick example: function wpd_filter_users( $query ) { $screen = get_current_screen(); if( … Read more

Disable Auto-Expanding Menu in WordPress Admin Menus

I see two options here – override the CSS, or remove the “active” classes with JavaScript (sadly there is no action/filter that we can do this server-side) – I opted for the JS approach, it’s cleaner, leaner and meaner: function wpse_227037_remove_menu_classes() { echo ‘<script>jQuery( “.wp-has-current-submenu.wp-menu-open” ).removeClass( “wp-has-current-submenu wp-menu-open” ).addClass( “wp-not-current-submenu” );</script>’; } add_action( ‘adminmenu’, ‘wpse_227037_remove_menu_classes’ … Read more

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