Welcome, visitor! Log in
 

Source View: kses_allowed_protocols

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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: 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.

Source View

Line Code
486  *
487  * @since 1.0.0
488  *
489  * @param string $string Content to filter through kses
490  * @param array $allowed_html List of allowed HTML elements
491  * @param array $allowed_protocols Optional. Allowed protocol in links.
492  * @return string Filtered content with only allowed HTML elements
493  */
494 function wp_kses($string, $allowed_html, $allowed_protocols = array ()) {
495      $allowed_protocols = wp_parse_args( $allowed_protocols, apply_filters('kses_allowed_protocols', array ('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn') ));
496      $string = wp_kses_no_null($string);
497      $string = wp_kses_js_entities($string);
498      $string = wp_kses_normalize_entities($string);
499      $allowed_html_fixed = wp_kses_array_lc($allowed_html);
500      $string = wp_kses_hook($string, $allowed_html_fixed, $allowed_protocols); // WP changed the order of these funcs and added args to wp_kses_hook
501      return wp_kses_split($string, $allowed_html_fixed, $allowed_protocols);
502 }
503
504 /**