add_role menu pages are not visible

The problem was, that I changed the capabilities AFTER I already created the role. I noticed, that if I change the roles slug, the role became duplicated. So I searched, and found remove_role( ‘tabellenadmin’ ); Add that line somewhere before add_role(). You first have to remove the role, before you can change it.

Removing admin menu items with white spaces

There are more reliable functions to remove menus and submenus in WP admin area. Those functions are remove_menu_page and remove_submenu_page. I don’t know if the menus you want to remove are top level menus or submenus neither the slug of the menus (needed for these functions), so I can not give you the exact code … Read more

How to add next height number in Order Attributes inside the Add new page. [duplicate]

add_action( ‘admin_footer’, ‘my_action_javascript’ ); // Write our JS below here function my_action_javascript() global $wpdb; $pageposts = $wpdb->get_var(“SELECT max(menu_order) FROM $wpdb->posts WHERE post_status=”publish” AND post_type=”post_trainers””); ?> <script type=”text/javascript” > jQuery(document).ready(function($) { var data = { ‘action’: ‘my_action’, ‘whatever’: <?=$pageposts?> }; $.post(ajaxurl, data, function(response) { if($(‘#menu_order’).val()==” || $(‘#menu_order’).val()==’0′) $(‘#menu_order’).val(response); }); }); </script> <?php } add_action( ‘wp_ajax_my_action’, ‘my_action_callback’ … Read more

admin menu naming

This post may help you to achieve your goal. http://code.tutsplus.com/articles/customizing-your-wordpress-admin–wp-24941 example would be like below, function edit_admin_menus() { global $menu; global $submenu; $menu[5][0] = ‘Recipes’; // Change Posts to Recipes $submenu[‘edit.php’][5][0] = ‘All Recipes’; $submenu[‘edit.php’][10][0] = ‘Add a Recipe’; } add_action( ‘admin_menu’, ‘edit_admin_menus’ );

How to create menu in Word Press 4.2.2?

You can find Menus in the Appearance->Menus area in the admin. Are you using a custom theme? If so, it might have menu support. Try switching to one of the default themes. If it still, doesn’t appear, disable all plugins and try again.

Hide certain post types from editors

Here a little function which takes care to hide (In admin) Custom Post Types. function remove_from_admin_menu(){ // Check capability (admin) if( current_user_can( ‘edit_dashboard’ )){ //Do nothing } elseif ( current_user_can( ‘moderate_comments’ ) ) { // editor capability remove_menu_page( ‘edit.php?post_type=cpt01’ ); // add here your cpt name remove_menu_page( ‘edit.php?post_type=cpt02’ ); remove_menu_page( ‘edit.php?post_type=cpt03’ ); // for submenu … Read more

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