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
- Advantages and disadvantages of using automatic-feed-links
- Change admin bar to default:off
- Convert hyphen to underscore in permalinks
- Create thumbnail on PDF upload with Gravity Forms
- Enqueue Style in Functions.php
- Different functions file for each site in multisite installation?
- jQuery plugin function is not a function
- Limit posts only on home page – ideally in functions.php
- Change Default Font Size and Remove Unwanted Font Sizes in TinyMCE
- Loop (iterate) through Multi-Site sub-sites (blogs)?
- Proper way of using functions in action hook?
- Not sure if enqueuing js scripts properly
- Best practices regarding the creation of custom widgets?
- How to remove style attribute in WordPress RSS output?
- Multiple Loops Meta Data
- How to stop wordpress from injecting hard-coded style into image attachments with captions
- If ACF field is empty show different value [closed]
- What is the text that appears beside the page titles in the list of pages in the WP admin?
- Two functions with different arguments and add_actions, but identical code
- How to fix get_the_category function returning incorrect slug?
- Auto log in hook is requiring a page refresh
- Testing for a shortcode using a function. 404 page throwing PHP Notice
- How to get post revisions in my custom rest API? [closed]
- Possible to merge these two functions?
- The_content and Preg_replace in loaded Iframe [closed]
- dynamic site link for future migration in echo do_shortcode()
- Hide tab Buddypress profile for visitors, not logged in users
- Add a mature content warning to first-time visitors
- Show Featured Image in else statement
- Function to check if custom page is used by page?
- 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?
- Bizarre Child Menu Issue on WP Site
- get variables data from functions.php to template wordpress (without global variables)
- how to increase connection time
- Shortcode to insert default text and change one word throughout it?
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- Add schema to Search result page’s body. Tried using is_search
- Drop down list code for sidebar
- Shortcode Initialization in a Custom Theme
- Hide disclaimer from summary excerpts
- Open image size links in a page instead of direct image link
- Allow tags and attributes in post and pages content
- Override parent theme function that is not hooked or in the functions.php file
- Function to get thumbnail img source
- Syntax for a function in order to get post’s title in JSON encoded response [closed]
- Comment Function
- WP Custom Comment Callback Not Responding
- Replace TinyMCE with Custom Built Editor
- Do something when user creates post (that’s pending)
- Add product to cart from functions.php
- How I can show short content with short tag
- Is storing in a variable the result of a fonction a most powerful way to code an if structures in WordPress?