Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #20210, comment 11


Ignore:
Timestamp:
09/08/2012 04:40:17 PM (12 years ago)
Author:
ryan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20210, comment 11

    v2 v3  
    1  * Introduce wp_kses_allowed_htm() which accepts a context string and returns an array of allowed tags.
     1 * Introduce wp_kses_allowed_html() which accepts a context string and returns an array of allowed tags.
    22 * Removes explicit declarations of class, id, style, and title from $allowedposttags
    3  * wp_kses_allowed_htm() dynamically adds the global attributes to every tag for the 'post' context
     3 * wp_kses_allowed_html() dynamicallly adds the global attributes to every tag for the 'post' context
    44 * No longer calls wp_kses_array_lc() every time wp_kses() runs. Instead it runs once if CUSTOM_TAGS is true. Plugins directly passing a custom allowed_html array would no longer get the lc treatment. We need to see if that would be a problem.
    55 * wp_kses_data() and wp_filter_kses() pass current_filter() for the $allowed_html argument to wp_kses().
    6  * wp_kses_allowed_htm() handles being passed a filter name for a context. If the filter is not a recognized one it defaults to using $allowedtags as was done before for wp_kses_data() and wp_filter_kses().
    7  * wp_kses_allowed_htm() recognizes user_description and pre_user_description out of the box. For these it takes $allowedtags and inserts rel attribute support.
    8  * wp_kses_allowed_htm() allows plugins to override the return values for the default contexts and support arbitrary contexts via a wp_kses_allowed_html filter.
    9  *  wp_kses_hook() can now pass a string context for $allowed_html to the pre_kses filter. We might have to pass the result of wp_kses_allowed_htm() instead if it turns out that plugins are digging in $allowed_html.
     6 * wp_kses_allowed_html() handles being passed a filter name for a context. If the filter is not a recognized one it defaults to using $allowedtags as was done before for wp_kses_data() and wp_filter_kses().
     7 * wp_kses_allowed_html() recognizes user_description and pre_user_description out of the box. For these it takes $allowedtags and inserts rel attribute support.
     8 * wp_kses_allowed_html() allows plugins to override the return values for the default contexts and support arbitrary contexts via a wp_kses_allowed_html filter.
     9 *  wp_kses_hook() can now pass a string context for $allowed_html to the pre_kses filter. We might have to pass the result of wp_kses_allowed_html() instead if it turns out that plugins are digging in $allowed_html.
    1010 * @todo There are several spots in $allowedposttags where array() can be replaced with true. If we go with this I'll tidy that up.
    1111