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 |
---|---|
628 | /** |
629 | * Filter HTML elements allowed for a given context. |
630 | * |
631 | * @since 3.5.0 |
632 | * |
633 | * @param string $tags Allowed tags, attributes, and/or entities. |
634 | * @param string $context Context to judge allowed tags by. Allowed values are 'post', |
635 | * 'data', 'strip', 'entities', 'explicit', or the name of a filter. |
636 | */ |
637 | return apply_filters( 'wp_kses_allowed_html', $context, 'explicit' ); |
638 | } |
639 |
|
640 | switch ( $context ) { |
641 | case 'post': |
642 | /** This filter is documented in wp-includes/kses.php */ |
643 | return apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context ); |
644 |
|
645 | case 'user_description': |
646 | case 'pre_user_description': |
647 | $tags = $allowedtags; |
648 | $tags['a']['rel'] = true; |
649 | /** This filter is documented in wp-includes/kses.php */ |
650 | return apply_filters( 'wp_kses_allowed_html', $tags, $context ); |
651 |
|
652 | case 'strip': |
653 | /** This filter is documented in wp-includes/kses.php */ |
654 | return apply_filters( 'wp_kses_allowed_html', array(), $context ); |
655 |
|
656 | case 'entities': |
657 | /** This filter is documented in wp-includes/kses.php */ |
658 | return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context); |
659 |
|
660 | case 'data': |
661 | default: |
662 | /** This filter is documented in wp-includes/kses.php */ |
663 | return apply_filters( 'wp_kses_allowed_html', $allowedtags, $context ); |
664 | } |
665 | } |
666 |
|
667 | /** |
668 | * You add any kses hooks here. |
669 | * |
670 | * There is currently only one kses WordPress hook and it is called here. All |
671 | * parameters are passed to the hooks and expected to receive a string. |
672 | * |