Give Editor Access to Custom Theme Options

The problem is that the default Editor role does not have enough capabilities to change theme options. You are allowing users with ‘moderate_comments’ capabilities to view the page. That in itself is not enough. When the user attempts to update, it fails because the user does not have the proper capabilities, hence the ‘Cheatin’ uh?’ … Read more

How to stop displaying the Id without losing the functionality

the_author_meta displays the data. That is, it echos the data to the screen. From the Codex entry for that function: NOTE: Use get_the_author_meta() if you need to return (not display) the information. So, use get_the_author_meta() instead. There is a somewhat reliable pattern in WordPress function naming whereby functions starting with the_ echo data to the … Read more

Assign multiple roles , overlapping capabilities

I am pretty sure that nothing would happen other than the user would have the capability in question. Think about it. The default Roles share many capabilities— Authors, Editors, and Administrators all have edit_posts, for example. All roles (usually) have read The same system manages both default and custom roles/capabilities, so there really should be … Read more

Hide comments and posts posted by other user

You can use a filter to pre_get_posts so that only your posts are listed. Something like this: function my_posts_only( $query ) { global $pagenow; if ( ‘edit.php’ != $pagenow || ! $query->is_admin ) return $query; if ( ! current_user_can( ‘manage_options’ ) ) { global $user_ID; $query->set( ‘author’, $user_ID ); } return $query; } add_filter( ‘pre_get_posts’, … Read more

How to hide a HTML element based on user role

You could use something like this if you have jquery included in your page: <?php if ( is_super_admin() ) { ?> <script type=”text/javascript”> $( document ).ready(function() { $(“#IDofDivHoldingUserTopBar”).css(“display”, “none”); // ID of user top bar // ……………………….. OR $(“.ClassofDivHoldingUserTopBar”).css(“display”, “none”); // class of user top bar }); </script> <?php } ?>

Custom Roles for access to specific term(s)

First I have a question, what you want to give them access to. Editing posts that have a certain category or seeing it on the site? When it comes to Roles, as is the case usually the codex is a great place to start – http://codex.wordpress.org/Roles_and_Capabilities. Specifically http://codex.wordpress.org/Function_Reference/add_role.

Bind custom role to admin page

So for your information (based on add_menu_page) i am suggesting you to check the codex of add_menu_page in wordpress http://codex.wordpress.org/Function_Reference/add_menu_page if you look into the parameter of add_menu_page third one is for $capability just change it below code manage_options to manage_wpse_173073 (or any name you want) and just assign that capability to your custom role. … Read more

How to allow Contributors to publish articles after approval

How can I make the contributor rank able to publish an article but have it then require the approval of an admin before it actually gets published to the website? The “Contributor” role already behaves that way: Contributor delete_posts edit_posts read https://codex.wordpress.org/Roles_and_Capabilities#Contributor As you see, that role lacks the publish_posts capability of the role just … Read more

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