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 |
---|---|
543 | /** |
544 | * Filter HTML elements allowed for a given context. |
545 | * |
546 | * @since 3.5.0 |
547 | * |
548 | * @param string $tags Allowed tags, attributes, and/or entities. |
549 | * @param string $context Context to judge allowed tags by. Allowed values are 'post', |
550 | * 'data', 'strip', 'entities', 'explicit', or the name of a filter. |
551 | */ |
552 | return apply_filters( 'wp_kses_allowed_html', $context, 'explicit' ); |
553 | } |
554 |
|
555 | switch ( $context ) { |
556 | case 'post': |
557 | /** This filter is documented in wp-includes/kses.php */ |
558 | return apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context ); |
559 | break; |
560 | case 'user_description': |
561 | case 'pre_user_description': |
562 | $tags = $allowedtags; |
563 | $tags['a']['rel'] = true; |
564 | /** This filter is documented in wp-includes/kses.php */ |
565 | return apply_filters( 'wp_kses_allowed_html', $tags, $context ); |
566 | break; |
567 | case 'strip': |
568 | /** This filter is documented in wp-includes/kses.php */ |
569 | return apply_filters( 'wp_kses_allowed_html', array(), $context ); |
570 | break; |
571 | case 'entities': |
572 | /** This filter is documented in wp-includes/kses.php */ |
573 | return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context); |
574 | break; |
575 | case 'data': |
576 | default: |
577 | /** This filter is documented in wp-includes/kses.php */ |
578 | return apply_filters( 'wp_kses_allowed_html', $allowedtags, $context ); |
579 | } |
580 | } |
581 |
|
582 | /** |
583 | * You add any kses hooks here. |
584 | * |
585 | * There is currently only one kses WordPress hook and it is called here. All |
586 | * parameters are passed to the hooks and expected to receive a string. |
587 | * |