If you simply want to modify content to be output by the_content()
but after the shortcodes have been applied, there is a much simpler approach. Shortcodes are filtered in the_content
with priority 11 as can be seen in default-filters.php:
add_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop()
So just write a filter function and hook it with a higher value for priority, so the content passes through it after shortcodes have been replaced.
public function __construct() {
add_filter( 'the_content', array( $this, 'wpse_253803_filter' ), 20 );
}
public function wpse_253803_filter( $content ) {
//do some stuff
return $content;
}
Related Posts:
- How can i remove all html tags from get_the_content()?
- Changing the HTML Of the content
- append PHP function to the_content
- WordPress Wysiwyg Content not being displayed
- Go to / Scroll to Password Field on WordPress Posts After Submit With Message(s)
- Extremely slow pageload for long post when using the_content?
- Output 2 items within the Loop
- Wrap First Character after in a tag
- How to call function at the bottom of post using plugin?
- How do I Add HTML to the_excerpt() & the_content() Output?
- Showing content from one page on another
- Removing “wpautop” (auto tags) only on certain pages?
- Get URL from shortcode tag
- How to debug this search & replace strings snippet?
- Getting content from a referenced post
- Only first shortcode gets executed
- What are the advantages/disadvantages of using jQuery DOM manipulation as opposed to PHP DOM manipulation?
- How to hook code to show after the_content?
- Create a WordPress shortcode using PHP [duplicate]
- Get the_content surrounded by instead of
- How to turn each phone number within the $content to a telephone link?
- WordPress the_content Page Load
- Including Custom fields within the_content
- Strip from or something better?
- Problem in replacing the_content with the_excerpt()
- How to Create custom block for displaying information in content section which act like shortcode
- Give ID to divs inside the loop
- How to bind each “the_content” elements to a custom variables
- Replace an array (with identical values) with another array in the_content
- Is there a way to have chunks of a page’s content expire?
- Excerpt all post content Content Same Size without word cutting off
- How to use multiple query with same meta key
- How to create a custom config file and get data using inline JS in a wordpress page
- How to Remove a Filter from the Admin List Table?
- Remove commas from WooCommerce checkout addresses fields
- Getting the dropdown menu to redirect to different pages?
- enqueue multiple Google fonts with multiple weights and styles (italic)
- How to display user nickname (not display name) in PHP template?
- Extract subdomain and relative address from a url
- Accessing site’s root from themes folder
- Passing PHP Function Arguments from CLI vs URL
- tracking number field in Woocommerce order [closed]
- Count top level menu items
- hook that when page is starting to load
- Ajax category filtering products default show all
- How to exclude category ID from Looper in WordPress
- Custom user login page by creating a plugin
- Why ajax doesn’t work on certain wordpress hooks?
- Whitelisting items from custom options page
- Add_menu_page not displaying the menu in class based plugin
- Approve post and send the password
- multiple taxonomy select display only one in front end
- How to store options in an array
- Generate sidebar depending on height of post
- Get author and excerpt from URL
- Error using WordPress $wpdb object to get result from custom table
- Sidebar not appearing in footer, but it appears everywhere else!
- How to create table in wordpress without plugin? [closed]
- How do you create two separate Register pages?
- In WordPress, how do I get the number of posts next to single_cat_title(”); in the category.php file?
- Include only posts with meta key “add_in_rss” in RSS Feed
- Need help with Code Correction php+wordpress
- get db values for external js file
- How to exclude a widget from W3 Total Cache Plugin
- What should I write in the post action of this front end post form?
- How to split AJAX response into two divs
- Deleting expired session tokens in WordPress
- Payment field disappears on custom Paypal plugin
- Creating a brand attribute as a variable
- Illegal string offset in PHP function in via Theme Customizer
- How to hide the file name of 404.php in URL?
- when hooking to pre_user_query my wordpress crashes when using very simple commands?
- Loop for recently (updated_post_meta) posts?
- I am having errors with checkout on wordpress
- Display articles with a different template in the home page | Solved |
- How to retrieve quantity input field by id in woocommerce
- How to use Multi SQL Database in WordPress?
- Help me understand how Search function works using dynamic_sidebar()
- How to display post meta bellow every posts
- Sudden Upload HTTP errors, PHP uploads and memory limits are already to high to my taste. Anything else?
- form submission reverts to index.php template
- Handling form actions in WordPress
- i want add conditional for add category in wordpress
- PHP code printed into CSS classes
- Thumbnail wouldn’t scale to size properly
- PHP script to redirect traffic based on website accessed
- How to remove title tag with this filter
- How to handle the structure of page/taxonomy/post without making wordpress get confused with the url
- Add two or multiple functions in WordPress Post or Page
- Can’t put a hyperlink on Featured Post’s Image
- special characters not supporting in wordpress
- Custom user roles doesn’t apply changes
- A Space being added to url generated by custom plugin
- Why this plugin is not working?
- get_post_meta is always empty when I use wp_mail
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- Incomplete term slugs output from a foreach loop with get_the_terms
- Too many if’s and else if’s ?? – Must be better way [closed]
- How can precision be improved for the debug log timestamp?
- AJAX WP_Query’s order and orderby parameters not working