There is an add_meta_boxes
function that fires that you can hook into – it fires whenever the edit post page is rendered.
At that point, you can get the ID of the post being edited using get_the_ID()
. You can then compare it to the ID for which you want to remove the post editor:
function remove_pages_editor(){
if(get_the_ID() == 23) {
remove_post_type_support( 'post', 'editor' );
} // end if
} // end remove_pages_editor
add_action( 'add_meta_boxes', 'remove_pages_editor' );
Related Posts:
- Tiny MCE-modifications (plugins) stopped working in WordPress 5.6
- WordPress wraps span tags into p tags
- Remove heading tags on line break
- Why does my visual post editor break when I try to add a TinyMCE button?
- How do I get the current edit page ID in the admin?
- Modify Admin Bar Link
- Disable visual editor on one specific page
- TinyMCE custom styles remove class when switching styles
- How to remove row-actions from pages table?
- Is it possible to remove the main rich Text box editor?
- Add admin bar link to edit author
- TinyMCE custom stylesheets for different post types
- Replacing select2 in admin backend for all selects
- echo or print_r in an admin function
- How to add a column to the Trash page?
- How to test for Super Admin
- How to select a page within admin?
- Change Admin Bar “Visit Site” URL
- Adding html format on tinymce visual editor
- How to Display Frontend CSS for Administrator only
- Hard-coding custom menu elements for menu manager
- How to make custom column Admin>Users sortable?
- Trigger a custom function when option are saved in admin area
- Move ‘current-menu-item’ class on #adminmenu li from Posts to Pages for Taxonomy Edit Screen
- Force to use STRONG users password and implement rule to prevent REUSE [closed]
- Adding a colorbutton in tinymce dialog with current api
- Javascript function not working when placed in Text Block
- Custom styles.css sheet for visual editor
- Disabling visual editor on a specific post
- Logout Redirect and also WP-login.php Redirect
- what is best way to keep track of changes made in wordpress website? [closed]
- Custom styles in Tiny MCE with an external CSS file
- Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?
- Adding tables to the WordPress Editor
- Removing WPML Items From the WordPress Admin Bar
- Show metadata in users.php – wordpress
- How to display my comment count in the wordpress admin bar?
- Classic TinyMCE messing up only Contributor’s HTML
- TinyMCE Multiple Custom Classes Selections
- Multisite Admin Roles
- Quicktags external functions file
- Edit TinyMCE Button Functionality
- Unregistering custom tinymce plugin?
- function to return comma separated list of meta values
- Screen Options WordPress WYSIWYG
- Change TinyMCE undeline outpout
- How to sort a non-meta field in the User Admin Panel?
- WordPress Categories: Function using custom SQL to return array of specific category IDs
- How can I remove page titles without removing the link in the navigation bar in twentyeleven?
- Problem with WordPress output text (‘esc_html’ & ‘wp_richedit_pre’)
- How to apply the ‘current_page_item’ class to an archive page in `wp_list_pages()`?
- Conditional custom menu?
- What function actually renders the wp_admin_bar ? How can I call it?
- Keyboard shortcut for headings on safari
- Facebook OpenGraph error, Call to undefined function wp_get_attachment_src()
- wp_enqueue_script() not working
- Simplest Way to Build Custom Archives Page?
- Filter for replacing the WP_query object for a given category
- Custom user role still showing up after deletion, ideas?
- Do I Need to Prefix Variables Inside Functions?
- Best Browser for Editing Posts
- How to change a meta value (of a published post) after X days.?
- referencing the current user in a page i created in wordpress
- Unable to use get_page_by_title() more than once per page?
- Editor cannot access Theme Options
- Add a custom function to widget code
- the_excerpt function not showing image
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- Need To Resize Images Exactly Without Losing Image Details
- Problem with shortcode inside a shortcode
- How to add or delete default value theme options while activate and deactivate theme
- Echo youtube code from url or shortcode
- What is the most efficient way of adding additional functionaliy for admin only
- Display ACF category image on archive and single template files
- Get URLs for AJAX Filter Checkboxes WordPress
- How to get taxonomy tree ids without running expensive loops
- Message notification for user
- Get slug of current category in functions.php
- wordpress built-in Jalali date convertor
- Disable autosave with `function.php` for custom post wordpress?
- sort metabox columns in listing Single
- WordPress login set cookie that survive browser exit (wp_signon function)
- wp_nav_menu displaying all pages
- WordPress 6.0 upgrade caused my custom function to stop working
- How to avoid saving empty data to sql while using add_meta_box
- How to assign php file(template) to several pages with same prefix page name/slug
- How to Display WooCommerce Product Price in WooCommerce Archive
- How to change text color depending on the number value (Using javascript)
- is_main_query() always returning false
- Woocommerce Variable Product Dropdown for Custom Shop Template
- Is this a backup door?
- Create Custom URL structure for specific Post category using Post ID instead of post name
- Include widget file in functions.php of child theme
- WordPress comment processing . Default unapproved comments detection before posting
- Astra theme – cannot set short product description under the product title (product name)
- Warning at top of website & top menu gone
- Featured Image and Tags problem
- Is posible to redirect a few URL?
- Need help making a short code work