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-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
Note: See TracChangeset for help on using the changeset viewer.