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