| | 389 | |
| | 390 | /** |
| | 391 | * Call a shortcode function by tag name. |
| | 392 | * |
| | 393 | * We can now avoid evil calls to do_shortcode( '[shortcode]' ). |
| | 394 | * |
| | 395 | * @since 3.8.0 |
| | 396 | * |
| | 397 | * @param string $tag The shortcode whose function to call. |
| | 398 | * @param array $atts The attributes to pass to the shortcode function. Optional. |
| | 399 | * @param array $content The shortcode's content. Default is null. |
| | 400 | * |
| | 401 | * @return string|bool False on failure, the result of the shortcode on success. |
| | 402 | */ |
| | 403 | function call_shortcode_func( $tag, $atts = array(), $content = null ) { |
| | 404 | |
| | 405 | global $shortcode_tags; |
| | 406 | |
| | 407 | if ( ! isset( $shortcode_tags[ $tag ] ) ) |
| | 408 | return false; |
| | 409 | |
| | 410 | return call_user_func( $shortcode_tags[ $tag ], $atts, $content, $tag ); |
| | 411 | } |