+ $string = wp_kses_hook($string, $allowed_html, $allowed_protocols); // WP changed the order of these funcs and added args to wp_kses_hook
+ return wp_kses_split($string, $allowed_html, $allowed_protocols);
+}
+
+/**
+ * Return a list of allowed tags and attributes for a given context.
+ *
+ * @since 3.5.0
+ *
+ * @param string $context The context for which to retrieve tags. Allowed values are
+ * post | strip | data | entities or the name of a field filter such as pre_user_description.
+ * @return array List of allowed tags and their allowed attributes.
+ */
+function wp_kses_allowed_html( $context = '' ) {
+ global $allowedposttags, $allowedtags, $allowedentitynames;
+
+ if ( is_array( $context ) ) {
+ /**
+ * Filter HTML elements allowed for a given context.
+ *
+ * @since 3.5.0
+ *
+ * @param string $tags Allowed tags, attributes, and/or entities.
+ * @param string $context Context to judge allowed tags by. Allowed values are 'post',
+ * 'data', 'strip', 'entities', 'explicit', or the name of a filter.
+ */
+ return apply_filters( 'wp_kses_allowed_html', $context, 'explicit' );
+ }
+
+ switch ( $context ) {
+ case 'post':
+ /** This filter is documented in wp-includes/kses.php */
+ return apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context );
+ break;
+ case 'user_description':
+ case 'pre_user_description':
+ $tags = $allowedtags;
+ $tags['a']['rel'] = true;
+ /** This filter is documented in wp-includes/kses.php */
+ return apply_filters( 'wp_kses_allowed_html', $tags, $context );
+ break;
+ case 'strip':
+ /** This filter is documented in wp-includes/kses.php */
+ return apply_filters( 'wp_kses_allowed_html', array(), $context );
+ break;
+ case 'entities':
+ /** This filter is documented in wp-includes/kses.php */
+ return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context);
+ break;
+ case 'data':
+ default:
+ /** This filter is documented in wp-includes/kses.php */
+ return apply_filters( 'wp_kses_allowed_html', $allowedtags, $context );
+ }