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(….)”
- When is the ‘post_content_filtered’ column in database cleared by WordPress?
- Can posts have parents?
- Where is the old post permalink slug stored?
- Separate Database Tables For Different Post Types
- Hook that get’s triggered when the author of a post is changed
- The hook for the AJAX Add to Cart button?
- 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 can I safely increase the character limit for post passwords?
- How to Group Posts by the First Letter or Number?
- Restore contents of deleted user
- 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”?
- Better post meta efficiency?
- Count singular post views automatically
- How to change post status from publish to draft using hook in wordpress?
- Custom Taxonomies Incorrectly Counting Revisions?
- Filter post before *editing*
- WordPress Delete hook with wp_delete_post function?
- Custom function for “Submit for Review” hook
- First hook to use current page post id
- database columns: post_title vs post_name
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- Exporting Data from WordPress into a flat table
- How to place HTML below the title of the (custom) post overview
- 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?
- Importing New Posts from Live Site into Local Dev Site
- Does an action fire when adding a tag via the “Tags” meta box?
- Manually removing revision post types
- Are posts updated or built from revisions + autosaves?
- How can i do something after head like adding a hook for after head but before post
- How much of my site can I recover from public_html?
- Reset/Reorder posts ID in the MySQL wp_posts table
- How to store an extra (surrogate) ID when creating a post with wp_insert_post?
- How do I find which articles are missing a featured image in The WordPress database?
- Split WP_POST table based on post types
- 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
- Multiples Empty Posts were created and cannot delete them
- 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?
- Adding buttons to Add New Post and Add New Page
- use wpml_post_language_details function other plugin based on $post->ID [closed]
- Hide a specific category in admin All Posts page (WordPress)
- After database migration, posts not showing up in dashboard
- How to access $post from a callback function
- Updating post data on save (save_post vs wp_insert_post_data)
- Transferring WordPress Database – Serialised data
- Emojis replaced by ‘?’ automatically
- WordPress Local And Live Site
- Can’t update old posts 3.5.2
- When open add new post or page WordPress add post with ID=0 continuously [closed]
- Hooking into the post editing screen for an existing page only
- wp_posts table: safely remove unused columns to save database storage
- 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?
- How to dynamically parse and transform post/page content before displaying it?
- 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”
- why the same code got different results when using query_posts in functions.php and index.php
- How safe is it to delete old posts edits to save database space?
- Divs appearing everywhere in post content
- Modify posts listing at back end
- Delete post revisions only for a single post
- Hook for changing excerpt content when excerpt not set
- Is it possible to add a shortcode below post title?
- Move posts from a non-wordpress site to wordpress
- wp_posts table extremely large
- How to Assign / Move all Deleted post to a category
- Display post number by category
- Automatically set post_parent value
- Saving Post Data in Another Database
- Restore woocommerce orders
- How to select particular month post from table and update the post status using MySQL?
- Update field in database for users
- 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?