WordPress.org

Making WordPress.org

Changeset 4112


Ignore:
Timestamp:
09/20/2016 07:10:35 PM (4 years ago)
Author:
ocean90
Message:

Rosetta: Allow users with the 'edit_theme_options' capability to change the site title in the customizer.

See #2003.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/site/class-locale-team.php

    r4108 r4112  
    6161        add_filter( 'user_has_cap', [ $this, 'extend_editors_capabilities' ], 10, 4 );
    6262        add_filter( 'editable_roles', [ $this, 'remove_administrator_from_editable_roles' ] );
     63        add_action( 'customize_register',  [ $this, 'allow_editors_to_change_site_title_in_customizer' ], 20 );
    6364    }
    6465
     
    99100        return $roles;
    100101    }
     102
     103    /**
     104     * Allows users with the 'edit_theme_options' capability to change the site title
     105     * in the customizer.
     106     *
     107     * @param WP_Customize_Manager $wp_customize The customizer object.
     108     */
     109    public function allow_editors_to_change_site_title_in_customizer( $wp_customize ) {
     110        $wp_customize->get_setting( 'blogname' )->capability = 'edit_theme_options';
     111        $wp_customize->get_setting( 'blogdescription' )->capability = 'edit_theme_options';
     112    }
    101113}
Note: See TracChangeset for help on using the changeset viewer.