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 |
---|---|
509 | /** |
510 | * Filter HTML elements allowed for a given context. |
511 | * |
512 | * @since 3.5.0 |
513 | * |
514 | * @param string $tags Allowed tags, attributes, and/or entities. |
515 | * @param string $context Context to judge allowed tags by. Allowed values are 'post', |
516 | * 'data', 'strip', 'entities', 'explicit', or the name of a filter. |
517 | */ |
518 | return apply_filters( 'wp_kses_allowed_html', $context, 'explicit' ); |
519 | } |
520 |
|
521 | switch ( $context ) { |
522 | case 'post': |
523 | /** This filter is documented in wp-includes/kses.php */ |
524 | return apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context ); |
525 | break; |
526 | case 'user_description': |
527 | case 'pre_user_description': |
528 | $tags = $allowedtags; |
529 | $tags['a']['rel'] = true; |
530 | /** This filter is documented in wp-includes/kses.php */ |
531 | return apply_filters( 'wp_kses_allowed_html', $tags, $context ); |
532 | break; |
533 | case 'strip': |
534 | /** This filter is documented in wp-includes/kses.php */ |
535 | return apply_filters( 'wp_kses_allowed_html', array(), $context ); |
536 | break; |
537 | case 'entities': |
538 | /** This filter is documented in wp-includes/kses.php */ |
539 | return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context); |
540 | break; |
541 | case 'data': |
542 | default: |
543 | /** This filter is documented in wp-includes/kses.php */ |
544 | return apply_filters( 'wp_kses_allowed_html', $allowedtags, $context ); |
545 | } |
546 | } |
547 |
|
548 | /** |
549 | * You add any kses hooks here. |
550 | * |
551 | * There is currently only one kses WordPress hook and it is called here. All |
552 | * parameters are passed to the hooks and expected to receive a string. |
553 | * |