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