It seems you’re actually looking for the the_content
filter.
add_filter('the_content', 'modify_content');
function modify_content($content) {
global $post;
if ($post->ID != $desired_id)
return $content;
$modified_content = /* modify content here */;
return $modified_content;
}
Related Posts:
- Get old values for post before saving new ones
- Filter post before *editing*
- How can i do something after head like adding a hook for after head but before post
- How to retrieve the postID in a “image_send_to_editor” hook function?
- What is the filter or hook to add admin controls to posts on the front end?
- use wpml_post_language_details function other plugin based on $post->ID [closed]
- Adding bootstrap classes to video shortcodes
- Modify posts listing at back end
- Hook for changing excerpt content when excerpt not set
- Is it possible to add a shortcode below post title?
- Restricting displayed posts to posts from only select authors
- How to get the postID inside ‘content_save_pre’? Other hook?
- Modify upload directory to use post category slug in file path on multisite installation
- Apply the_title() filter in post & page title, but not in menu title
- Update post counts (published, draft, unattached) in admin interface
- Removing any and all inline styles from the_content()
- Hook that get’s triggered when the author of a post is changed
- Removing filter dropdown in posts table (in this case Yoast SEO)
- The hook for the AJAX Add to Cart button?
- Execute function when post is published
- how to limit edit_form_after_title hook to page and post edit only?
- How does filter the_posts work?
- How to publish a post with empty title and empty content?
- How to add a “publish” link to the quick actions
- Action hook ‘wp’ firing twice… why?
- In what sequence are the hooks fired when a post is “published”?
- Why is wordpress removing some unicode characters (e.g. some emojis) when I save my post?
- Better post meta efficiency?
- Count singular post views automatically
- how to display post content without post image?
- Exclude category on blog list page
- How to remove_filter that filters iframes in posts? [duplicate]
- Filter posts by author and category simultaneously
- How to change post status from publish to draft using hook in wordpress?
- Filter/Remove HTML Elements on all posts and pages
- WordPress Delete hook with wp_delete_post function?
- Custom function for “Submit for Review” hook
- First hook to use current page post id
- How to filter content post only on save
- how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?
- 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?
- If specific user role then sticky post
- Does an action fire when adding a tag via the “Tags” meta box?
- Getting post id from wp_insert_post_data function?
- the_posts filter been called multiple time
- Filter Posts By Tag
- Custom excerpt length filter doesn’t work
- Are posts updated or built from revisions + autosaves?
- Only display posts after current date
- Amend wordpress password function
- Custom Post Templates
- How can I remove posts of a certain category from homepage after a specified time period?
- How to generate numbers indistinguishable for the IDs of the posts
- Modify WP_Post before processing
- How to filter posts that belong to a specific category only if that is the only category
- Action hook for new pending posts?
- Filter Custom Post Type by Category with Ajax
- Register post status, exclude from searches
- Ajax posts filter by date, comments, top views, top likes
- How to add Tags Filter in wordpress admin dashboard
- pre_get_posts query between 2 dates (date stored in custom post meta)
- Applying $posts_clauses filter to specific queries only
- how to remove dash (-) post status from post title on posts listing page wordpress
- Admin Posts Table Column Fitlering is not working for Custom Post Type
- Get latest posts from WordPress site without header, menu and sidebar
- Modify Image Source With The_Content Filter?
- How to modify post content?
- Which WordPress hook fires after post content loaded?
- Change post order random through out the entire WordPress
- Adding buttons to Add New Post and Add New Page
- How to hide html tags on revision comparison pages?
- Add filter by custom field to block of posts
- Ajax post filters not working
- Default to ‘all’ view on the ‘edit-post’ screen for authors
- Hide a specific category in admin All Posts page (WordPress)
- Display Meta Values in Custom Filter – Admin Custom Posts
- How to filter my search in post if contains a word in title, content or excerpt?
- More then one menu items are assigned with “current-menu-item” class
- Update post_content everytime a custom post is opened in backend
- How to access $post from a callback function
- Updating post data on save (save_post vs wp_insert_post_data)
- Posts and Attachments with “Published” status in Search
- How to allow visitors to filter posts by multiple taxonomies
- Copy post to separate database with “add_action(….)”
- Hooking into the post editing screen for an existing page only
- Call Web Services on post first publish
- add to end of post in the loop with plugin
- Add filter to the end of the post
- How to dynamically parse and transform post/page content before displaying it?
- Get post content with all filters applied, knowing post id
- What does WordPress do if I save a post without content/title? [duplicate]
- Is it possible to filter the main loop to exclude posts from a specific category?
- query post limits
- preg_replace not removed “class”
- why the same code got different results when using query_posts in functions.php and index.php
- Divs appearing everywhere in post content
- Filtering posts on Post Administration Page by Week Number instead of by Month
- Prevent posts with certain post_meta to be edited
- Change the default blog post post attribute template name from “default template” to something else