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
626      if ( is_array( $context ) ) {
627           /**
628            * Filters HTML elements allowed for a given context.
629            *
630            * @since 3.5.0
631            *
632            * @param array  $context      Context to judge allowed tags by.
633            * @param string $context_type Context type (explicit).
634            */
635           return apply_filters( 'wp_kses_allowed_html', $context, 'explicit' );
636      }
637
638      switch ( $context ) {
639           case 'post':
640                /** This filter is documented in wp-includes/kses.php */
641                return apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context );
642
643           case 'user_description':
644           case 'pre_user_description':
645                $tags = $allowedtags;
646                $tags['a']['rel'] = true;
647                /** This filter is documented in wp-includes/kses.php */
648                return apply_filters( 'wp_kses_allowed_html', $tags, $context );
649
650           case 'strip':
651                /** This filter is documented in wp-includes/kses.php */
652                return apply_filters( 'wp_kses_allowed_html', array(), $context );
653
654           case 'entities':
655                /** This filter is documented in wp-includes/kses.php */
656                return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context);
657
658           case 'data':
659           default:
660                /** This filter is documented in wp-includes/kses.php */
661                return apply_filters( 'wp_kses_allowed_html', $allowedtags, $context );
662      }
663 }
664
665 /**
666  * You add any kses hooks here.
667  *
668  * There is currently only one kses WordPress hook, {@see 'pre_kses'}, and it is called here.
669  * All parameters are passed to the hooks and expected to receive a string.
670  *