Make WordPress Core

Changeset 20232


Ignore:
Timestamp:
03/21/2012 04:59:57 AM (12 years ago)
Author:
koopersmith
Message:

Theme Customizer: Improve WP_Customize_Setting->check_capabilities(). Add support for arrays in WP_Customize_Setting->capability and WP_Customize_Setting->theme_supports. Don't bail when WP_Customize_Setting->capability is empty. see #19910.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-customize-section.php

    r20182 r20232  
    4747     */
    4848    function check_capabilities() {
    49         if ( ! $this->capability || ! current_user_can( $this->capability ) )
     49        if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) )
    5050            return false;
    5151
    52         if ( $this->theme_supports && ! current_theme_supports( $this->theme_supports ) )
     52        if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) )
    5353            return false;
    5454
  • trunk/wp-includes/class-wp-customize-setting.php

    r20181 r20232  
    268268        global $customize;
    269269
    270         if ( ! $this->capability || ! current_user_can( $this->capability ) )
     270        if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) )
    271271            return false;
    272272
    273         if ( $this->theme_supports && ! current_theme_supports( $this->theme_supports ) )
     273        if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) )
    274274            return false;
    275275
Note: See TracChangeset for help on using the changeset viewer.