Make WordPress Core

Changeset 27739


Ignore:
Timestamp:
03/26/2014 02:56:04 PM (13 years ago)
Author:
nacin
Message:

Inline documentation for hooks in wp-includes/kses.php.

props siobhyb, DrewAPicture.
fixes #25800.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/kses.php

    r27707 r27739  
    502502        global $allowedposttags, $allowedtags, $allowedentitynames;
    503503
    504         if ( is_array( $context ) )
     504        if ( is_array( $context ) ) {
     505                /**
     506                 * Filter HTML elements allowed for a given context.
     507                 *
     508                 * @since 3.5.0
     509                 *
     510                 * @param string $tags    Allowed tags, attributes, and/or entities.
     511                 * @param string $context Context to judge allowed tags by. Allowed values are 'post',
     512                 *                        'data', 'strip', 'entities', 'explicit', or the name of a filter.
     513                 */
    505514                return apply_filters( 'wp_kses_allowed_html', $context, 'explicit' );
     515        }
    506516
    507517        switch ( $context ) {
    508518                case 'post':
     519                        /** This filter is documented in wp-includes/kses.php */
    509520                        return apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context );
    510521                        break;
    … …  
    513524                        $tags = $allowedtags;
    514525                        $tags['a']['rel'] = true;
     526                        /** This filter is documented in wp-includes/kses.php */
    515527                        return apply_filters( 'wp_kses_allowed_html', $tags, $context );
    516528                        break;
    517529                case 'strip':
     530                        /** This filter is documented in wp-includes/kses.php */
    518531                        return apply_filters( 'wp_kses_allowed_html', array(), $context );
    519532                        break;
    520533                case 'entities':
     534                        /** This filter is documented in wp-includes/kses.php */
    521535                        return apply_filters( 'wp_kses_allowed_html', $allowedentitynames, $context);
    522536                        break;
    523537                case 'data':
    524538                default:
     539                        /** This filter is documented in wp-includes/kses.php */
    525540                        return apply_filters( 'wp_kses_allowed_html', $allowedtags, $context );
    526541        }
    … …  
    541556 */
    542557function wp_kses_hook( $string, $allowed_html, $allowed_protocols ) {
    543         $string = apply_filters('pre_kses', $string, $allowed_html, $allowed_protocols);
     558        /**
     559         * Filter content to be run through kses.
     560         *
     561         * @since 2.3.0
     562         *
     563         * @param string $string            Content to run through kses.
     564         * @param array  $allowed_html      Allowed HTML elements.
     565         * @param array  $allowed_protocols Allowed protocol in links.
     566         */
     567        $string = apply_filters( 'pre_kses', $string, $allowed_html, $allowed_protocols );
    544568        return $string;
    545569}
    … …  
    14151439
    14161440        $css_array = explode( ';', trim( $css ) );
     1441
     1442        /**
     1443         * Filter list of allowed CSS attributes.
     1444         *
     1445         * @since 2.8.1
     1446         *
     1447         * @param array $attr List of allowed CSS attributes.
     1448         */
    14171449        $allowed_attr = apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float',
    14181450        'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color',
Note: See TracChangeset for help on using the changeset viewer.