Make WordPress Core

Changeset 31083


Ignore:
Timestamp:
01/08/2015 06:01:08 AM (10 years ago)
Author:
wonderboymusic
Message:

In Customizer classes:

  • public final function methods should be final public function - confusing Hack and aligns with PSR2
  • Some methods were missing access modifiers

See #30799.

Location:
trunk/src/wp-includes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-oembed.php

    r30681 r31083  
    273273     * @return false|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
    274274     */
    275     function get_html( $url, $args = '' ) {
     275    public function get_html( $url, $args = '' ) {
    276276        $provider = $this->get_provider( $url, $args );
    277277
  • trunk/src/wp-includes/class-wp-customize-control.php

    r30991 r31083  
    184184     * @return bool Whether the control is active to the current preview.
    185185     */
    186     public final function active() {
     186    final public function active() {
    187187        $control = $this;
    188188        $active = call_user_func( $this->active_callback, $this );
     
    225225     * @return mixed The requested setting's value, if the setting exists.
    226226     */
    227     public final function value( $setting_key = 'default' ) {
     227    final public function value( $setting_key = 'default' ) {
    228228        if ( isset( $this->settings[ $setting_key ] ) ) {
    229229            return $this->settings[ $setting_key ]->value();
     
    271271     * @return bool False if theme doesn't support the control or user doesn't have the required permissions, otherwise true.
    272272     */
    273     public final function check_capabilities() {
     273    final public function check_capabilities() {
    274274        foreach ( $this->settings as $setting ) {
    275275            if ( ! $setting->check_capabilities() )
     
    291291     * @return string Contents of the control.
    292292     */
    293     public final function get_content() {
     293    final public function get_content() {
    294294        ob_start();
    295295        $this->maybe_render();
     
    305305     * @uses WP_Customize_Control::render()
    306306     */
    307     public final function maybe_render() {
     307    final public function maybe_render() {
    308308        if ( ! $this->check_capabilities() )
    309309            return;
     
    976976    }
    977977
    978     function print_header_image_template() {
     978    public function print_header_image_template() {
    979979        ?>
    980980        <script type="text/template" id="tmpl-header-choice">
     
    11861186     * @return bool Whether the widget is rendered.
    11871187     */
    1188     function active_callback() {
     1188    public function active_callback() {
    11891189        return $this->manager->widgets->is_widget_rendered( $this->widget_id );
    11901190    }
  • trunk/src/wp-includes/class-wp-customize-panel.php

    r30714 r31083  
    167167     * @return bool Whether the panel is active to the current preview.
    168168     */
    169     public final function active() {
     169    final public function active() {
    170170        $panel = $this;
    171171        $active = call_user_func( $this->active_callback, $this );
     
    222222     * @return bool False if theme doesn't support the panel or the user doesn't have the capability.
    223223     */
    224     public final function check_capabilities() {
     224    final public function check_capabilities() {
    225225        if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
    226226            return false;
     
    241241     * @return string Content for the panel.
    242242     */
    243     public final function get_content() {
     243    final public function get_content() {
    244244        ob_start();
    245245        $this->maybe_render();
     
    254254     * @since 4.0.0
    255255     */
    256     public final function maybe_render() {
     256    final public function maybe_render() {
    257257        if ( ! $this->check_capabilities() ) {
    258258            return;
  • trunk/src/wp-includes/class-wp-customize-section.php

    r30714 r31083  
    176176     * @return bool Whether the section is active to the current preview.
    177177     */
    178     public final function active() {
     178    final public function active() {
    179179        $section = $this;
    180180        $active = call_user_func( $this->active_callback, $this );
     
    231231     * @return bool False if theme doesn't support the section or user doesn't have the capability.
    232232     */
    233     public final function check_capabilities() {
     233    final public function check_capabilities() {
    234234        if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
    235235            return false;
     
    250250     * @return string Contents of the section.
    251251     */
    252     public final function get_content() {
     252    final public function get_content() {
    253253        ob_start();
    254254        $this->maybe_render();
     
    263263     * @since 3.4.0
    264264     */
    265     public final function maybe_render() {
     265    final public function maybe_render() {
    266266        if ( ! $this->check_capabilities() ) {
    267267            return;
  • trunk/src/wp-includes/class-wp-customize-setting.php

    r30676 r31083  
    171171     * @return false|null False if cap check fails or value isn't set.
    172172     */
    173     public final function save() {
     173    final public function save() {
    174174        $value = $this->post_value();
    175175
     
    200200     * @return mixed The default value on failure, otherwise the sanitized value.
    201201     */
    202     public final function post_value( $default = null ) {
     202    final public function post_value( $default = null ) {
    203203        // Check for a cached value
    204204        if ( isset( $this->_post_value ) )
     
    386386     * @return bool False if theme doesn't support the setting or user can't change setting, otherwise true.
    387387     */
    388     public final function check_capabilities() {
     388    final public function check_capabilities() {
    389389        if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) )
    390390            return false;
Note: See TracChangeset for help on using the changeset viewer.