@@ 911-927 (lines=17) @@ | ||
908 | * |
|
909 | * @return string Content with shortcodes filtered out. |
|
910 | */ |
|
911 | public function do_shortcode($content) |
|
912 | { |
|
913 | if (empty(self::$shortcode_tags) || !is_array(self::$shortcode_tags)) { |
|
914 | return $content; |
|
915 | } |
|
916 | ||
917 | $pattern = $this->get_shortcode_regex(); |
|
918 | ||
919 | return preg_replace_callback( |
|
920 | "/$pattern/s", |
|
921 | array( |
|
922 | $this, |
|
923 | '_do_shortcode_tag', |
|
924 | ), |
|
925 | $content |
|
926 | ); |
|
927 | } |
|
928 | ||
929 | /** |
|
930 | * Retrieve the shortcode regular expression for searching. |
|
@@ 1118-1135 (lines=18) @@ | ||
1115 | * |
|
1116 | * @return string Content without shortcode tags. |
|
1117 | */ |
|
1118 | public function strip_shortcodes($content) |
|
1119 | { |
|
1120 | ||
1121 | if (empty(self::$shortcode_tags) || !is_array(self::$shortcode_tags)) { |
|
1122 | return $content; |
|
1123 | } |
|
1124 | ||
1125 | $pattern = $this->get_shortcode_regex(); |
|
1126 | ||
1127 | return preg_replace_callback( |
|
1128 | "/$pattern/s", |
|
1129 | array( |
|
1130 | $this, |
|
1131 | '_strip_shortcode_tag', |
|
1132 | ), |
|
1133 | $content |
|
1134 | ); |
|
1135 | } |
|
1136 | ||
1137 | /** |
|
1138 | * Strip shortcode by tag. |