)', TpsMisc::mb_substr( $content, $begin - 4, 4 ), $beginMatches ) && preg_match( '()', TpsMisc::mb_substr( $content, $end + $lenEnd, 5 ), $endMatches ) && $beginMatches[1] === $endMatches[1] ) { $beginHeadingTag = $beginMatches[0]; $endHeadingTag = $endMatches[0]; } // Extract shortcode content. $shortCode = $beginHeadingTag . trim( TpsMisc::mb_substr( $content, $begin + $lenBegin, $end - $begin - $lenBegin ) ) . $endHeadingTag; // Parse newlinews. if ( $parseParagraphs ) { $shortCode = wpautop( $shortCode ); } // Get resulting post content by removing the shortcode and its content. { $split1 = $begin - TpsMisc::mb_strlen( $beginHeadingTag ); $split2 = $end + $lenEnd + TpsMisc::mb_strlen( $endHeadingTag ); // Remove trailing paragraph tags. if ( TpsMisc::mb_substr( $content, $split1 - 3, 3 ) == '
' && TpsMisc::mb_substr( $content, $split2, 4 ) == '
' ) { $split1 -= 4; $split2 += 4; } $content = trim( TpsMisc::mb_substr( $content, 0, $split1 ) ) . trim( TpsMisc::mb_substr( $content, $split2 ) ); } return $shortCode; } public static function tps_header( $atts, $content = null ) { return $content; } public static function tps_footer( $atts, $content = null ) { return $content; } public static function tps_title( $atts, $content = null ) { return $content; } }