You could do something like (in your functions.php file);
if(current_user_can('member')){
add_filter('get_sample_permalink_html', 'perm', '',4);
function perm($return, $id, $new_title, $new_slug){
$post = get_post( $id );
if( ! $post || ( $post->post_type !== 'testimonials' ) )
{
return $return;
}
return preg_replace(
'/<span id="edit-slug-buttons">.*<\/span>|<span id=\'view-post-btn\'>.*<\/span>/i',
'',
$return
);
}
To give credit where credit is due, everything between
if( $_GET['role'] == "member" ) {
and
}
…is directly taken from this Question & Answer HERE courtesy of Jonathan Wold
UPDATE
The conditional if statement of;
if( $_GET['role'] == "member" ) {//code here }
was replaced with,
if(current_user_can('member')){ //code here}
…in this instance.
Related Posts:
- Allow role to delete posts but block him the wp-admin
- How to remove a column from the Posts page
- How to display by default only published posts/pages in the admin area?
- Set Default Listing “View” in Admin
- How to Check if a Page Exists by URL?
- Use category base slug in posts’ permalink
- Allow user to “edit_others_posts” to save only, not publish
- Sends out email to admin
- Can I force a metabox to be in one column?
- Post slugs and images cannot have same name?
- Change the Slug of Post Type post to baseurl/post/%postname%
- Pretty URL with add_query_var
- Any way to create a revision of a post ONLY with a new button in the Meta Box?
- using slug instead of ID in admin edit post url
- get_permalink returns default link
- Add role that restricts user to post in specific category
- Group Posts by First Letter of Title
- how to get permalink using sql
- Change slug with custom field
- Post custom permalink results in 404 for archive page
- Custom colors for post rows based on post meta value
- How to add an admin function only to posts, not pages?
- Custom post type single (permalink) throws a 404 error
- What Defines What Category A Post Picks (if in multiple)
- Custom post type permalinks breaking due to 3.1 bug fix
- How can a guest view the “Pending Review” Post?
- change default post archive page link
- Adding a text link under the post title in the lists of posts
- Downgrade user from role that allows post creation
- Change default Posts page
- Bulk update post slugs through database
- Posts with multiple authors with different roles
- How to change permalink on post click on post listing page
- Disable inline_edit() on edit.php
- WordPress not opening posts with only numbers if permalink is post_name
- Change user role when post approve
- Stop users posting into category while still seeing contents of the category
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- After database migration, posts not showing up in dashboard
- How to allow users to post only in certain category and hide elements from edit page?
- Change target of view link in admin
- Switch to page template when using post permalink
- How to handle broken links created by permalink/slug changes?
- Visting slug for ‘post’ post type shows 404 not archive?
- Delete post after x minutes if user role is
- Show posts by author of membership level (Paid Membership Pro)
- How to add the time of a post to the list of posts on the administration page?
- custom word in custom permalink structure
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- I don’t want the complete article to show on homepage
- Internal linking to posts permalink fail because of spaces and stripe at postname
- Link post images to post
- Send email to admin with post author
- Problems with WordPress in subfolder, posts show a blank page
- Show 10 latest posts only from users with contributors role
- Rewriting blog permalinks
- Change permalinks for posts & for custom post types
- Add checkbox in admin post list – show checked post in widget
- Cannot create new posts or upload images using media manager
- How to set the post permalink using the WordPress REST API?
- How do I scope out why I have two “posts” menus in an admin?
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- unable to display two post per page in wordpress front-page.php
- How to 301 redirect from url with post id to permalink with post name (slug)?
- Custom Post Types and Broken Permalinks
- Custom permalink for wordpress page / post
- Permalink structure for two seperate blogs
- My post permalinks are always the same
- How to give priority to page than to posts permalink structure?
- Disable `create_post` for built-in post type
- Append a random string to a post permalink
- Add new post only in assigned category
- Fixing the WP Post Object for Custom Route
- All my posts don’t show, only the headline is displayed on the homepage
- How to change post template via url?
- Admin Post List Only Show One Category
- Posts in Page – How to customize the URL?
- Is there a way to change the complete URL of the blog post for a redirecting tracking link?
- WordPress with static posts page and custom permalink structure doesn’t find posts with numeric permalinks
- Can’t seem to replicate permalink structure for localhost development site
- WordPress rewrite url help needed
- Permalink of some posts change
- My posts section for logged in user
- How to mix pages and sub-categories in a url
- Why is $_POST Empty in Profile Edit Admin?
- Changing permalink of custom category
- TCPDF and permalinks
- Authors can edit all posts, except when an owner is specified?
- Overwrite URL on blog posts
- WordPress sub-posts and permalinks
- WordPress Admin Tables in Post View
- each user having category with their name and can add sub categories post in that category
- 301 Redirecting posts without %postid% (just %post_name%) in permalink to ones with %post_name%_%postid%
- Read more link not working [closed]
- Post Format Status [closed]
- How to change Permalinks only for Blogposts
- Permalink structure for two separate blogs
- Blog posts are not appearing as subs of Blog Page
- How to add paraent in Blog post URL in wordpress
- Change permalinks in posts via SQL