Changeset 36611
- Timestamp:
- 02/22/2016 05:30:30 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-nav-menus.php
r36586 r36611 48 48 $this->previewed_menus = array(); 49 49 $this->manager = $manager; 50 51 // Skip useless hooks when the user can't manage nav menus anyway. 52 if ( ! current_user_can( 'edit_theme_options' ) ) { 53 return; 54 } 50 55 51 56 add_filter( 'customize_refresh_nonces', array( $this, 'filter_nonces' ) ); -
trunk/src/wp-includes/class-wp-customize-widgets.php
r36586 r36611 84 84 public function __construct( $manager ) { 85 85 $this->manager = $manager; 86 87 // Skip useless hooks when the user can't manage widgets anyway. 88 if ( ! current_user_can( 'edit_theme_options' ) ) { 89 return; 90 } 86 91 87 92 add_filter( 'customize_dynamic_setting_args', array( $this, 'filter_customize_dynamic_setting_args' ), 10, 2 ); -
trunk/tests/phpunit/tests/customize/widgets.php
r36586 r36611 24 24 parent::setUp(); 25 25 require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); 26 27 $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); 28 wp_set_current_user( $user_id ); 26 29 $GLOBALS['wp_customize'] = new WP_Customize_Manager(); 27 30 $this->manager = $GLOBALS['wp_customize']; … … 41 44 remove_action( 'after_setup_theme', 'twentysixteen_setup' ); 42 45 remove_action( 'customize_register', 'twentysixteen_customize_register', 11 ); 43 44 $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );45 wp_set_current_user( $user_id );46 46 47 47 $this->backup_registered_sidebars = $GLOBALS['wp_registered_sidebars'];
Note: See TracChangeset
for help on using the changeset viewer.