WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/21/2012 04:59:57 AM (8 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.