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 |
|---|---|
| 490 | * |
| 491 | * @param string $context The context for which to retrieve tags. Allowed values are |
| 492 | * post | strip | data | entities or the name of a field filter such as pre_user_description. |
| 493 | * @return array List of allowed tags and their allowed attributes. |
| 494 | */ |
| 495 | function wp_kses_allowed_html( $context = '' ) { |
| 496 | global $allowedposttags, $allowedtags, $allowedentitynames; |
| 497 | |
| 498 | if ( is_array( $context ) ) |
| 499 | return apply_filters( 'wp_kses_allowed_html', $context, 'explicit' ); |
| 500 | |
| 501 | switch ( $context ) { |
| 502 | case 'post': |
| 503 | return apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context ); |
| 504 | break; |
| 505 | case 'user_description': |
| 506 | case 'pre_user_description': |
| 507 | $tags = $allowedtags; |
| 508 | $tags['a']['rel'] = true; |
| 509 | return apply_filters( 'wp_kses_allowed_html', $tags, $context ); |
| 510 | break; |
| 511 | case 'strip': |
| 512 | return apply_filters( 'wp_kses_allowed_html', array(), $context ); |
| 513 | break; |
| 514 | case 'entities': |
| 515 | return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context); |
| 516 | break; |
| 517 | case 'data': |
| 518 | default: |
| 519 | return apply_filters( 'wp_kses_allowed_html', $allowedtags, $context ); |
| 520 | } |
| 521 | } |
| 522 | |
| 523 | /** |
| 524 | * You add any kses hooks here. |
| 525 | * |
| 526 | * There is currently only one kses WordPress hook and it is called here. All |
| 527 | * parameters are passed to the hooks and expected to receive a string. |
| 528 | * |