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 7 times in this file.
Line | Code |
---|---|
869 |
|
870 | /** |
871 | * Filters the HTML tags that are allowed for a given context. |
872 | * |
873 | * @since 3.5.0 |
874 | * |
875 | * @param array[] $html Allowed HTML tags. |
876 | * @param string $context Context name. |
877 | */ |
878 | return apply_filters( 'wp_kses_allowed_html', $html, $context ); |
879 | } |
880 |
|
881 | switch ( $context ) { |
882 | case 'post': |
883 | /** This filter is documented in wp-includes/kses.php */ |
884 | $tags = apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context ); |
885 |
|
886 | // 5.0.1 removed the `<form>` tag, allow it if a filter is allowing it's sub-elements `<input>` or `<select>`. |
887 | if ( ! CUSTOM_TAGS && ! isset( $tags['form'] ) && ( isset( $tags['input'] ) || isset( $tags['select'] ) ) ) { |
888 | $tags = $allowedposttags; |
889 |
|
890 | $tags['form'] = array( |
891 | 'action' => true, |
892 | 'accept' => true, |
893 | 'accept-charset' => true, |
894 | 'enctype' => true, |
895 | 'method' => true, |
896 | 'name' => true, |
897 | 'target' => true, |
898 | ); |
899 |
|
900 | /** This filter is documented in wp-includes/kses.php */ |
901 | $tags = apply_filters( 'wp_kses_allowed_html', $tags, $context ); |
902 | } |
903 |
|
904 | return $tags; |
905 |
|
906 | case 'user_description': |
907 | case 'pre_user_description': |
908 | $tags = $allowedtags; |
909 | $tags['a']['rel'] = true; |
910 | /** This filter is documented in wp-includes/kses.php */ |
911 | return apply_filters( 'wp_kses_allowed_html', $tags, $context ); |
912 |
|
913 | case 'strip': |
914 | /** This filter is documented in wp-includes/kses.php */ |
915 | return apply_filters( 'wp_kses_allowed_html', array(), $context ); |
916 |
|
917 | case 'entities': |
918 | /** This filter is documented in wp-includes/kses.php */ |
919 | return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context ); |
920 |
|
921 | case 'data': |
922 | default: |
923 | /** This filter is documented in wp-includes/kses.php */ |
924 | return apply_filters( 'wp_kses_allowed_html', $allowedtags, $context ); |
925 | } |
926 | } |
927 |
|
928 | /** |
929 | * You add any KSES hooks here. |
930 | * |
931 | * There is currently only one KSES WordPress hook, {@see 'pre_kses'}, and it is called here. |
932 | * All parameters are passed to the hooks and expected to receive a string. |
933 | * |