Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_kses_allowed_html

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 6 times in this file.

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