You might check out the content_edit_pre
filter.
Your example would then look like this:
function wpse89725_pre_edit_content( $content, $post_id ) {
$content = "nothing";
return $content;
}
add_filter( 'content_edit_pre', 'wpse89725_pre_edit_content', 10, 2 );
You can read more about this filter in the Codex:
https://codex.wordpress.org/Plugin_API/Filter_Reference/content_edit_pre
Edit:
You can also try the edit_post_content
filter:
add_filter( 'edit_post_content', 'my_pre_edit_content', 10, 2 );
Since we have in the file /wp-includes/post.php
these lines:
$value = apply_filters("edit_{$field}", $value, $post_id);
// Old school
$value = apply_filters("{$field_no_prefix}_edit_pre", $value, $post_id);
both of these filters should work, but the filters *_edit_pre
seems to be on the way out and replaced by edit_*
.
Related Posts:
- Copy post to separate database with “add_action(….)”
- Where is the old post permalink slug stored?
- Get old values for post before saving new ones
- Execute function when post is published
- how to limit edit_form_after_title hook to page and post edit only?
- How to Group Posts by the First Letter or Number?
- How are terms connected with posts in database?
- Action hook ‘wp’ firing twice… why?
- Moving WordPress to new server: no posts found
- In what sequence are the hooks fired when a post is “published”?
- Count singular post views automatically
- How to change post status from publish to draft using hook in wordpress?
- Filter post before *editing*
- Custom function for “Submit for Review” hook
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- How can I hook into creating a new post and execute wp_die(), before the post is inserted into the database?
- Insert posts in two tables
- Instead of submiting an entire post, is there any way to submit a lite-post or a simple message?
- Does an action fire when adding a tag via the “Tags” meta box?
- Are posts updated or built from revisions + autosaves?
- How much of my site can I recover from public_html?
- Reset/Reorder posts ID in the MySQL wp_posts table
- Most recent post from another database
- Action hook for new pending posts?
- How to retrieve the postID in a “image_send_to_editor” hook function?
- What structure should post_content have in the database?
- Register post status, exclude from searches
- How to delete all the content of a wordpress site without deleting the Post and pages?
- Extracting post categories
- Which WordPress hook fires after post content loaded?
- What is the filter or hook to add admin controls to posts on the front end?
- Hide a specific category in admin All Posts page (WordPress)
- How to access $post from a callback function
- Updating post data on save (save_post vs wp_insert_post_data)
- Can’t update old posts 3.5.2
- When open add new post or page WordPress add post with ID=0 continuously [closed]
- Anyone know why wordpress converts some html entities to their numeric equivalents?
- Remove a shortcode from all WordPress posts
- Trying to alter the post_content through the_post
- What do these phpMyAdmin errors mean on my WordPress databaes?
- Call Web Services on post first publish
- What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?
- why there are so many posts whoes post_type is revision? will these records waste too much database space?
- Delete all drafts?
- Is it possible to use WP_Query to only pull posts with attachments?
- What does WordPress do if I save a post without content/title? [duplicate]
- Get posts and include taxonomy term
- Adding bootstrap classes to video shortcodes
- Why my wp_posts data is so huge?
- Add field to user meta table in database when link is clicked
- preg_replace not removed “class”
- How safe is it to delete old posts edits to save database space?
- Divs appearing everywhere in post content
- Delete post revisions only for a single post
- Is it possible to add a shortcode below post title?
- wp_posts table extremely large
- How to Assign / Move all Deleted post to a category
- Automatically set post_parent value
- Saving Post Data in Another Database
- Restore woocommerce orders
- Import custom database into wp and keep the post id
- why the posts queried from sql is more than those showed on the page?
- Moved to a new server, backup was a day old and missing 3 posts, anyway to recover them from old host?
- Is there a function to get post info for any publish_status by post ID?
- Your ideas on my though “delete or move all of the posts in a specific category when 3 days are passed”
- How Can I Always Display A Particular Post First Using WP_Query?
- Help on conditional statement to accompany wp_insert_post function please?
- How can I globally italicize list of texts in the UI database or Posts? [closed]
- Posting to WP via URL
- Is there a way to know when a page has been updated and do some action only once?
- Restricting displayed posts to posts from only select authors
- Menu Items disappearing/being empty on save or post edit
- Hook when post is set from published to draft?
- Prevent a post with a specific ID from being created
- Bulk find & replace on WordPress posts/pages (minus image paths)
- Get Category in save_post Hook
- Count singular post views automatically
- How can I stop ‘in use’ message from intermittently blocking my wp_posts table?
- More Than 50K Categories and WordPress Admin Panel Stop Showing Categories and Posts
- how i show manual data in a post
- Maximum number of posts per page before affecting performance?
- SQL trigger failes with post_content
- Can’t get post_updated hook to work
- Surrogate ID for posts, is there an alternative field in the posts table?
- wp query custom orderby not custom field
- get backup file from wordpress database in x days
- How to remove related post from home page
- Expired Post with More Recent Time Stamp?
- Converting Posts to Pages
- How to change the publishing date of each posts?
- Checking if some condition is matched before inserting post into database
- Extra field in wp_post instead of postmeta
- Voting System, database connections?
- Given two custom post types: Automatically add meta fields from one custom post type to another
- Which hooks are essential for post templates?
- Load posts from external source if not found in database
- save_post not working
- What effect can a large wp_post table have on overall site performance?
- Admin notice on wp_insert_post
- Change permalinks in posts via SQL