You can do something like this :
function wpse_113057_hide_publish_buttons(){
$cpt="your_post_type";// can be post
global $post;
if($post->post_type == $cpt && current_user_can('members') ){
echo '
<style type="text/css">
.misc-pub-section, #delete-action {
display:none;
}
</style>
';
}
}
add_action('admin_head-post.php', 'wpse_113057_hide_publish_buttons');
add_action('admin_head-post-new.php', 'wpse_113057_hide_publish_buttons');
I did not find a hook to do this with some PHP.
Hope this helps.
Related Posts:
- Where are custom field values stored in the database
- Custom post meta field effect on the performance on the post
- Using TinyMce with textareas in meta boxes on custom post types
- Having different sidebar content for MANY pages?
- How can I fetch CSS from JSON WP REST API response
- How to set a default meta value for custom field
- Create meta boxes that don’t show in custom fields
- How To Create a Metabox of HTML Content with Instructions For Editors When Editing a Post or Page?
- Plugins won’t recognize my plugin’s hidden custom fields
- wp_editor in add_meta_boxes does not show gallery
- Calling Specific Pages with wp query Part II
- How do I assign this filter to a variable? (Appending php & markup to the_content)
- If value present, order posts by two consecutive custom fields
- Copying Custom Meta Values from existing post to a duplicate post
- Save page data to an xml file
- How to filter a dd/mm/yyyy date from a custom field in a query
- List posts with common custom field value
- Create Posts using Import>RSS/WXR/XML and pass values to Custom Fields
- Best way to add custom / magic / flutter fields into RSS feed
- Importing users to Buddypress with custom fields
- How to save a ToggleControl value in a meta field?
- Is it bad to use a lot of Custom Meta Fields?
- How to get multiple checkboxes in one meta field
- How to get customfield value by woocommerce product ID
- How do I get the url slug inside the dashboard for a custom post type?
- How do I use Ajax to build a dropdown of custom fields based on a post selected in previous dropdown?
- Register rest field for specific user
- Custom Field Suite A little problem
- Audio player shortcode not showing up when using variable
- Save the_content into custom field
- get_posts that haven’t been assigned a specific custom field
- how to upload a image from frontend with wp_insert_post and also update_post_meta?
- Get updated meta value after post update or published (custom post type) using hook
- Custom dropdown field added to media gallery; how to get it to save properly?
- Insert a custom field into a shortcode and use it in post(s)
- Sort alphabetically by custom field
- Uploading PDF using Media Uploader
- Why orderbyb meta_value_num won’t affect the generated SQL Query order?
- Sorting editor screen items
- get post id using custom filed value
- How Do I Display A Custom Field In The Sidebar Of All My Pages?
- Query_posts with custom field meta value
- Passing meta_box string to post__in?
- Can data from a Custom Field data be used by a shortcode on a per page/post basis?
- How can I modify RSS item titles to be either the title or a custom meta field?
- Custom Field – Do Not Show if Value is Empty?
- Move Title and the Content WYSIWYG editor position
- WordPress built in custom fields don’t validate or sanitize? Is there a way to fix this?
- wp custom field date format compare
- frontend submit post jQuery clone row won’t save
- WordPress colorpicker save both hex and RGB
- Can’t get video meta from wp_read_video_metadata()
- Best way to contruct a global custom field?
- Include one custom field in search results
- Custom search SQL Query to add custom field in result
- How to write specific HTML code with a specific custom field? [closed]
- How to style posts selecting a CSS post_class (added through custom_fields?)?
- Can wp_insert_post_data filter be used to save custom field data?
- Meta query relation ‘OR’ not working as expected
- How to hide custom fields added by a plugin?
- Custom field Search with Relavanssi
- How to exclude custom fields from search queries?
- Add Custom Fields After Page Title
- Footnotes in custom fields
- Image upload and path to custom field
- Create a new custom field for all posts based on current custom field
- Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches
- Listing posts with a value in a custom field
- Set class if a meta value is set within post archive
- Using Customizer API vs Custom Meta Box for custom content
- Filtering posts by ACF meta query
- WordPress admin area: select box with 12.000+ options
- Custom meta boxes – add php code inside?
- How to use a custom field with add_rewrite_rule()?
- to create a custom post type with additionnal url field such as link to social network and an email field
- User custom meta delete by serialised key value
- Metabox value for post loop?
- Using ACF Custom Field value in a URL with do_shortcode() [closed]
- Custom Post Field -> Returning only the word “array”
- Register author, facebook connect, publish posts from front end
- Custom field and category query
- Empty the_content for all posts
- Extend WP_Customize_Control with Multiple Field Control
- Display different category template if custom field is checked
- How can I create more “create attachment” custom field – any idea?
- Can i categorise my meta box?
- How to overwrite a value for a custom field?
- WordPress archives by custom field and date
- Decouple page name from page title
- When editing a post with a custom meta box the values aren’t displaying correctly
- Function to retrieve a picture if there is no picture is attached
- Show posts containing or not custom field
- How to get the value of particular get $meta value in wordpress
- custom field as a boolean with a checkbox?
- add_post_meta insert null value into Database
- Website that sells statistics
- Extract array from custom field
- extra post fields for url + youtube video / implementation
- Multiple permalinks for a single post from custom field
- Search for meta_query does not return any result if combined with title