Testing requested query in pre_get_posts
Testing requested query in pre_get_posts
Testing requested query in pre_get_posts
To add a role see: https://codex.wordpress.org/Function_Reference/add_role To add capabilities see: click add_cap link on the bottom A list of all caps see: https://codex.wordpress.org/Roles_and_Capabilities For all the roles you can also use them for different post types. if post type is “books” edit_pages -> edit_books. N.B.: This setting is saved to the database (in table wp_options, … Read more
Adding button to wordpress menu
Here’s a simple example that redirects to the edit posts screen. Since what you’re asking for is how to get the post, I’m not bothering with messages or particular redirect pages or other variables – though note that wp_die() will just kill the page. In my tests, it just gets you a blank one. Anyway, … Read more
You can use the remove_menu_page function from the admin_menu action. An example for you would be to add this to your functions file (this will remove those menu links for you as well). function remove_menus() { remove_menu_page( ‘options-general.php’ ); remove_menu_page( ‘profile.php’ ); } add_action( ‘admin_menu’, ‘remove_menus’ ); If you need to be more specific to … Read more
I know this post is old but the right answer may help someone else. Sounds like you are still using WordPress 3.* because it has a bug causing the issue. You need to be sure you’re using the right version of Apache and PHP as required by the copy of WordPress version you just upgraded … Read more
WP_User has a roles array. Get the current user with wp_get_current_user() and check if your role is in the array. add_action( ‘admin_bar_menu’, ‘remove_new_content_menu’, PHP_INT_MAX ); function remove_new_content_menu( $wp_admin_bar ) { // get the current user $user = wp_get_current_user(); // define roles that cannot see the `new content` button $blacklisted_roles = array(‘grocery’, ‘subscriber’); // remove the … Read more
The {$table_prefix}user_roles entry in the options table must begin with the actual table prefix. Your website was with a prefix of wp_ so the entry was called wp_user_roles. When modifying the table prefix you need to change it with the new one: dzup_wp_user_roles Hope it works !
Joe, as already said in this post, just by the image it looks like the dashboard style sheet of management is breaking. Try the right mouse button and click inspect. The area in question must be within the div with class. If not, try restoring your wp.
It could be that your upgrade hasn’t worked properly. Does it still think you have an upgrade to 4.7.2 waiting? Personally I would download a fresh copy of 4.7.2 and re-upload this to be sure nothing is broken or missing. Make sure to take a backup of your database and files should anything bad happen. … Read more