You can remove post type support for the editor on a conditional basis. The following should work:
add_action( 'add_meta_boxes', 'wpse45113_remove_editor' );
function wpse45113_remove_editor() {
// change the capability and post type to whatever is appropriate
if ( ! current_user_can( 'install_plugins' ) )
remove_post_type_support( 'post', 'editor' );
}
I’m using add_meta_boxes
because it fires not too long before the editor is initialized, but there are a number of hooks that would also work. You can similarly only add the meta box with the custom fields for those users within the same if block.
Related Posts:
- Tabindex on text input immediately after WordPress title input
- WP doesn’t show Array Custom Fields?
- Add new “Insert Into Post” button with another function
- Add meta data to the menu
- can you set a default value to a custom field
- Guest Author – How can I use custom fields to create guest author link?
- post meta data clearing on autosave
- How to reload the role specific registration form on validation errors?
- Add input field to ‘Pages > Edit Page’ through functions.php
- Auto-add paragraphs to custom field?
- Add description text under input field for new profile fields
- How to add a predefined custom field without using a plugin?
- Populate Custom Field Dropdown on Theme Install?
- Saving custom profile fields
- How to add content at the end of posts?
- Register rest field for specific user
- Add conditional custom option to ‘Display name publicly as’ dropdown
- How to show a gloabl message on a user profile page (in back end)?
- how to put a custom field value in variable
- Auto Populate Custom Field with Complex Value That Increase by One?
- Custom Metabox Not Saving
- Getting the ID of any image for use in functions.php
- Auto-remove custom field with no value on publish
- Display custom field values from posts on frontpage
- Custom Fields box in the post editor: Replace textareas with input elements
- How to allow users to post only in certain category and hide elements from edit page?
- Add additional ‘description’ field for defined roles / role metadata?
- Custom Field to a Role?
- Custom fields attached to a page template only show on edit screen when page is saved
- Display Custom Field for a Specific Role, but not for Admin
- Specific coditional usage [closed]
- Hide custom fields when empty
- HM CMB: Role Select
- Custom metabox not working
- Stripping and/or altering the content of a custom field (video URL)
- Odd functions.php issue in WordPress
- Making custom meta box required (with error message if not filled in) on Gutenberg
- HTML for adding a meta box (basic text field) to page editor?
- Hide custom fields by user’s role
- Meta boxes not displayed, data isn’t being saved
- Calling Custom Field within Function wrapped with Divs.
- Get fields from metabox array
- Including inline Custom Fields info with add_filter in functions.php
- file upload user profile
- How to automatically create a custom field when a post is published?
- Custom Admin Menu Report for Specific User ID
- clients list using wordpress
- Using wordpress post data as input for google visualisations
- Order posts by custom field and if custom field is empty return remaining posts
- Can serialized arrays in DB be matched against serialized arrays with meta_query?
- Create a select drop down of available menus
- Adding a prefix to a post title
- copy attachments to another post type and change attachment url
- Cannot edit post meta fields with rest API
- Only display custom field if it there is a value inside
- Add a post meta key and value only if it does not exist on the post
- Custom field values repeating
- Sorting posts by multiple values, combined
- Separate table or usermeta
- Woocommerce with metabox plugin
- trim custom field text value and show (…)
- Duplicate posts being displayed when querying Custom Fields
- Json api does not return all metadata
- Use custom field as a variable
- ACF: How to get the full field name (meta_key) by a field key?
- Is there a simpler version of WP Media?
- modify wordpress caption shortcode
- UPDATE on SELECT results. A SQL query to swap Author with Meta Box value
- Alter main archive, to show posts with meta as last
- Add microdata from schema.org [closed]
- Displaying multiple URLs as custom field values
- How can I save custom meta to one global value?
- Adding class to last list item? Not WP generated
- How to use media upload on metabox post page without breaking TinyMCE?
- Importing WordPress Posts With Custom Meta Data As CSV Files Through PHPMyAdmin
- Modify date query by URL parameter using pre_get_posts and $_GET
- The best way to collision check in WP
- Get meta field value of all catgories
- ACF field group not showing in page
- Filter post style attribute
- Updating Metadata with Shortcode
- Update some (not all) post titles with custom field values before running the Loop
- Arrays in custom fields or is there a better way?
- Setting user permissions per post
- Weird custom fields data lost
- WooCommerce 3 get custom variation on process order [closed]
- query_posts -> get page_id from custom field
- Output Custom Field value to shortcode
- Update custom table on metabox POST
- How to echo the translated custom field?
- display custom media folders to wordpress media popup
- change attachment custom field onChange event
- Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page
- Get custom field from other post in carousel
- Form fields based on custom fields
- show custom field content in jquery tabs
- Create citation and url in post using 3 custom fields with conditions for each field… So close!
- woocommerce how in checkout to add my custom field check box, and when i check it hide the shipping adress and add tax 19% [closed]
- Show only first image of multiple image field
- Custom Fields after update to WordPress 6