| @@ 891-907 (lines=17) @@ | ||
| 888 | * |
|
| 889 | * @return string Content with shortcodes filtered out. |
|
| 890 | */ |
|
| 891 | public function do_shortcode($content) |
|
| 892 | { |
|
| 893 | if (empty(self::$shortcode_tags) || !is_array(self::$shortcode_tags)) { |
|
| 894 | return $content; |
|
| 895 | } |
|
| 896 | ||
| 897 | $pattern = $this->get_shortcode_regex(); |
|
| 898 | ||
| 899 | return preg_replace_callback( |
|
| 900 | "/$pattern/s", |
|
| 901 | array( |
|
| 902 | $this, |
|
| 903 | '__do_shortcode_tag', |
|
| 904 | ), |
|
| 905 | $content |
|
| 906 | ); |
|
| 907 | } |
|
| 908 | ||
| 909 | /** |
|
| 910 | * Retrieve the shortcode regular expression for searching. |
|
| @@ 1098-1115 (lines=18) @@ | ||
| 1095 | * |
|
| 1096 | * @return string Content without shortcode tags. |
|
| 1097 | */ |
|
| 1098 | public function strip_shortcodes($content) |
|
| 1099 | { |
|
| 1100 | ||
| 1101 | if (empty(self::$shortcode_tags) || !is_array(self::$shortcode_tags)) { |
|
| 1102 | return $content; |
|
| 1103 | } |
|
| 1104 | ||
| 1105 | $pattern = $this->get_shortcode_regex(); |
|
| 1106 | ||
| 1107 | return preg_replace_callback( |
|
| 1108 | "/$pattern/s", |
|
| 1109 | array( |
|
| 1110 | $this, |
|
| 1111 | '__strip_shortcode_tag', |
|
| 1112 | ), |
|
| 1113 | $content |
|
| 1114 | ); |
|
| 1115 | } |
|
| 1116 | ||
| 1117 | /** |
|
| 1118 | * Strip shortcode by tag. |
|