diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php
index 057fad7..1029d88 100644
a
|
b
|
function do_shortcode( $content, $ignore_html = false ) { |
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
| 231 | * Execute a single shortcode with given attributes. |
| 232 | * |
| 233 | * @param string $tag Shortcode tag to run. |
| 234 | * @param array $atts Attributes to pass to the shortcode. |
| 235 | * @param string $content Content inside the tag. Null for self-closing. |
| 236 | * @return string|WP_Error Shortcode content, or WP_Error instance if invalid. |
| 237 | */ |
| 238 | function do_single_shortcode( $tag, $atts = array(), $content = null ) { |
| 239 | global $shortcode_tags; |
| 240 | if ( empty( $shortcode_tags ) || !is_array( $shortcode_tags ) || empty( $shortcode_tags[ $tag ] ) ) { |
| 241 | return new WP_Error( 'shortcode_invalid_tag', __( 'Shortcode is not registered' ), $tag ); |
| 242 | } |
| 243 | |
| 244 | $callback = $shortcode_tags[ $tag ]; |
| 245 | if ( ! is_callable( $callback ) ) { |
| 246 | return new WP_Error( 'shortcode_invalid_callback', __( 'Shortcode does not have a valid callback registered' ), $tag ); |
| 247 | } |
| 248 | |
| 249 | return call_user_func( $callback, $atts, $content, $tag ); |
| 250 | } |
| 251 | |
| 252 | /** |
231 | 253 | * Retrieve the shortcode regular expression for searching. |
232 | 254 | * |
233 | 255 | * The regular expression combines the shortcode tags in the regular expression |