WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 6 times in this file.
| Line | Code |
|---|---|
| 544 | /** |
| 545 | * Filter HTML elements allowed for a given context. |
| 546 | * |
| 547 | * @since 3.5.0 |
| 548 | * |
| 549 | * @param string $tags Allowed tags, attributes, and/or entities. |
| 550 | * @param string $context Context to judge allowed tags by. Allowed values are 'post', |
| 551 | * 'data', 'strip', 'entities', 'explicit', or the name of a filter. |
| 552 | */ |
| 553 | return apply_filters( 'wp_kses_allowed_html', $context, 'explicit' ); |
| 554 | } |
| 555 | |
| 556 | switch ( $context ) { |
| 557 | case 'post': |
| 558 | /** This filter is documented in wp-includes/kses.php */ |
| 559 | return apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context ); |
| 560 | |
| 561 | case 'user_description': |
| 562 | case 'pre_user_description': |
| 563 | $tags = $allowedtags; |
| 564 | $tags['a']['rel'] = true; |
| 565 | /** This filter is documented in wp-includes/kses.php */ |
| 566 | return apply_filters( 'wp_kses_allowed_html', $tags, $context ); |
| 567 | |
| 568 | case 'strip': |
| 569 | /** This filter is documented in wp-includes/kses.php */ |
| 570 | return apply_filters( 'wp_kses_allowed_html', array(), $context ); |
| 571 | |
| 572 | case 'entities': |
| 573 | /** This filter is documented in wp-includes/kses.php */ |
| 574 | return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context); |
| 575 | |
| 576 | case 'data': |
| 577 | default: |
| 578 | /** This filter is documented in wp-includes/kses.php */ |
| 579 | return apply_filters( 'wp_kses_allowed_html', $allowedtags, $context ); |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | /** |
| 584 | * You add any kses hooks here. |
| 585 | * |
| 586 | * There is currently only one kses WordPress hook and it is called here. All |
| 587 | * parameters are passed to the hooks and expected to receive a string. |
| 588 | * |