Stop users posting into category while still seeing contents of the category
Stop users posting into category while still seeing contents of the category
Stop users posting into category while still seeing contents of the category
Recently I had to tackle the same issue. Instead of setting the capability permanently for editors, I used user_has_cap filter to allow access dynamically. add_filter(‘user_has_cap’, ‘editor_allow_edit_menu’, 10, 4); function editor_allow_edit_menu($allcaps, $caps, $args, $user) { if ( ! isset( $allcaps[‘editor’] ) || true !== $allcaps[‘editor’] ) { return $allcaps; } global $pagenow; // new items are … Read more
You can use jQuery or plain javascript to add event listener to the role select element. E.g. jQuery(document).on(‘ready’, function(){ jQuery(‘select#role’).on(‘change’, function(){ // some if statement here alert(‘Role changed’); }); }); To add this to your admin you can either use admin_enqueue_scripts or admin_footer hooks. To enqueue script file, function my_admin_enqueue_scripts( $hook_suffix ) { if ( … Read more
i dont know how to achieve this in query arg. This is because it cannot be done using just arguments. No option for role is listed in the order/orderby parameter docs. There is no option to sort by user role in WordPress. Instead, you’re going to have to query for all gold role users, grab … Read more
Fix permissions for users role
I would suggest having a generic form that can be completed by the public on the front end. The submission of the form would would generate the post, saving a random string in its meta data (the password), and send an email containing a link to /?p=PAGEID&post_id=THE_POST_ID&pw=THE_PASSWORD. THE_POST_ID and THE_PASSWORD are those values from the … Read more
Admin User Role Unable to See Private Posts
Execute a ultimate member action when user role is updated
In a similar use case scenario, I had a client with 5 locations which could be assigned to the user. This will need to be changed for you because it’s based on location being assigned to both a user and a post, whereas you’re just going to assigning entire posts to users rather than matching … Read more
WordPress comments_open for specific user role or post type