Make WordPress Core


Ignore:
Timestamp:
02/18/2026 04:38:42 AM (6 months ago)
Author:
westonruter
Message:

Customize: Ensure WP_Customize_Setting::update() and subclass overrides return consistent types.

This addresses PHPStan type check issues.

Developed in https://github.com/WordPress/wordpress-develop/pull/10952

Props westonruter, peterwilsoncc, justlevine.
See #64238, #61175.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-nav-menu-setting.php

    r52597 r61670  
    467467         *
    468468         * @since 4.3.0
     469         * @since 7.0.0 Return type updated from null|void to bool for compatibility with base class.
    469470         *
    470471         * @see wp_update_nav_menu_object()
     
    479480         *     @type bool   $auto_add    Whether pages will auto_add to this menu. Default false.
    480481         * }
    481          * @return null|void
     482         * @return bool Whether updated.
    482483         */
    483484        protected function update( $value ) {
    484485                if ( $this->is_updated ) {
    485                         return;
     486                        return ( 'error' !== $this->update_status );
    486487                }
    487488
     
    583584                        }
    584585                }
     586
     587                return ( 'error' !== $this->update_status );
    585588        }
    586589
Note: See TracChangeset for help on using the changeset viewer.