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