JW Player Plugin for WordPress does not register its shortcode like all other shortcodes, so strip_shortcodes()
will not know about it and not strip it. In the code there is a note that this is because it uses argument names with a .
in it, and WordPress does not support this.
There are probably multiple ways to solve this, but I would copy the relevant line from strip_shortcodes()
and integrate the regex from the plugin:
function custom_excerpt( $length, $more_text ) {
global $post;
$text = get_the_content();
$text = strip_shortcodes( $text );
// Strip JW Player shortcode too
$text = preg_replace( '/(.?)\[(jwplayer)\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)/s', '$1$6', $text );
$text = apply_filters('the_content', $text);
// Continue with the rest of your function ...
Related Posts:
- Using “excerpt_more” filter for a specific post type
- How to add a shortcode button to the TinyMCE editor?
- How to customise the output of the WP image gallery shortcode from a plugin?
- How to include code only on specific pages?
- Custom media upload content for inserting custom post shortcode
- Checking if an attribute exists in a shortcode
- how to include other plugins css files in a shortcode?
- What characters are allowed as a shortcode tag and how should they be sanitized?
- All shortcodes not working on custom theme
- enqueue script only if it is not already enqueue
- Shortcode output appears before post body [duplicate]
- Autogenerate wordpress shortcodes using array?
- PHP Deprecated: Non-static method should not be called statically
- How to parse nested shortcodes?
- Loading shortcode with ajax
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Adding Custom Fields for Img in Posts
- How to call shortcode function directly and pass $atts
- How To Ignore a Filter On Applying Filter the Content In a Function
- Shortcode display outside the div
- How to pass multiple values in shortcode?
- Aggregate Summaries of Posts of Different Blogs in Multisite Instance
- append stylesheet via shortcode
- Shortcode under a Shortcode Multiple times Possible?
- Pass $this to function nested in another public function of the same class
- Modify Plugin shortcode function code
- Multiple calling javascript from shortcode in one page
- Sending post data over REST API, how to parse shortcodes in post_content?
- How to pass value to a plugins shortcode?
- Meta box or shortcode help
- Query Shortcode from a multisite to appear on a different site?
- function of parent not working in childtheme
- Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?
- Find all strings between an enclosing shortcode
- How Can the_post Be Hooked Like the_content and the_excerpt?
- Update Plugin Without Overwriting Custom Settings
- Hide some shortcodes on posts from back-end
- Trouble implementing python on WordPress
- wordpress Shortocode running twice?
- Is there a function to search for a wildcard value when calling a shortcode?
- Shortcode in a blog post, footer and related products stop working
- shortcode which is introduced into entry the blog, and appears in side bar
- Call/Run a Mathematica (.m) Shell Script from WordPress Page/Blog
- How to display single arbitrary facebook post with a shortcode?
- Multiple level shortcodes
- Custom shortcode with dynamic rewrite
- Posting code inside the post instead of in the template file using shortcode
- Allow user to input shortcode into wordpress widget
- How to use shortcode of any plugin to show it visually where i want?
- apply_filters to content but ignore shortcodes
- Space in WordPress Attribute Causing Problems
- Why function hooked using object are executing at all time?
- Shortcode registered from a plugin not recognized
- How to Set Limit with WordPress Get Bookmarks Shortcode
- Strange get_the_* behavior with php 5.4
- How to load a plugin when doing an Ajax call? [duplicate]
- Is it right way to create shortcode?
- Trying to override/intercept a PhotoMosaic gallery link in WordPress using jQuery
- Strip shortcode from excerpt [duplicate]
- Need to change contact email depending where user is from
- Get content or excerpt of top rated votes @GD-Star Rating? [closed]
- Convert usernames listed by the Groups plugin shortcode to displayed names?
- Pulling RSS from site and display it in posts
- Trying to Understand Shortcodes.
- Creating Features List in WordPress Post
- Shortcode return is printing a 1 afterward
- How to use ‘Event Manager Shortcodes’ plugin via the php code? [closed]
- Embedding BitBucket Code in Posting
- Next and Previous Pagination button not displaying in WordPress
- Do shortcodes affect page indexing by search engines?
- Creating a press page for our project
- do_shortcodes() isn’t working
- Any way to hook into WP after a page displays?
- WordPress shortcode plugin not working
- Integrate Razorpay quick payments plugin with contact form7 plugin
- WP Customer Reviews call short code on another page [closed]
- How to show in front End images using Visual Composer attach_images?
- Display HTML5 jQuery Audio Player On Front Page
- Shortcode returning specific content of a post
- Invalid argument supplied for foreach()
- Seo Problems in My meta Discription [closed]
- I am experiencing difficulty fulfilling client request
- cURL External API request displays content above other content on page
- Beginner question: Accessing js script in plugin
- Shortcode to do math with url variables
- How can I get the permalink of a page on which shortcode has been used
- Subtract Using GravityWP Count Plugin
- How to get URL param for pagination in shortcode?
- qTranslate‑X is not translating all shortcodes
- thumbnail_width not working in wordpress most popular post plugin
- Buffered output in chunks and shortcode – how do I achieve that?
- How can I add a zip code service availability checker in WordPress without Woocommerce? [closed]
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode
- Problem with a shortcode generating a error [closed]
- Display file contents within Plugin
- How do I edit text color for shortcode?
- correct way to enqueue js and css files for wordpress shortcode?
- How to get next day date of a specific day
- Custom Plugin not Displaying in the Website Production environment (Divi)
- Can I add two wordpress shortcode plugins in the same site (not the same page)?