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