strip_shortcodes example


function wp_trim_excerpt( $text = '', $post = null ) {
    $raw_excerpt = $text;

    if ( '' === trim( $text ) ) {
        $post = get_post( $post );
        $text = get_the_content( '', false, $post );

        $text = strip_shortcodes( $text );
        $text = excerpt_remove_blocks( $text );
        $text = excerpt_remove_footnotes( $text );

        /* * Temporarily unhook wp_filter_content_tags() since any tags * within the excerpt are stripped out. Modifying the tags here * is wasteful and can lead to bugs in the image counting logic. */
        $filter_removed = remove_filter( 'the_content', 'wp_filter_content_tags' );

        /** This filter is documented in wp-includes/post-template.php */
        
Home | Imprint | This part of the site doesn't use cookies.