Make WordPress Core


Ignore:
Timestamp:
05/21/2015 10:04:29 PM (11 years ago)
Author:
wonderboymusic
Message:

In class-wp-customize-*, clarify/add some @param/@return blocks. Disambiguate some functions that are trying to return the void response of another function they call internally.

See #32444.

File:
1 edited

Legend:

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

    r32034 r32535  
    134134        public function is_current_blog_previewed() {
    135135                if ( ! isset( $this->_previewed_blog_id ) ) {
    136                         return null;
     136                        return;
    137137                }
    138138                return ( get_current_blog_id() === $this->_previewed_blog_id );
     
    276276         * @since 3.4.0
    277277         *
    278          * @param mixed $value The value to sanitize.
    279          * @return mixed Null if an input isn't valid, otherwise the sanitized value.
     278         * @param string|array $value The value to sanitize.
     279         * @return string|array|null Null if an input isn't valid, otherwise the sanitized value.
    280280         */
    281281        public function sanitize( $value ) {
     
    332332         *
    333333         * @param mixed $value The value to update.
    334          * @return mixed The result of saving the value.
    335334         */
    336335        protected function _update_theme_mod( $value ) {
    337336                // Handle non-array theme mod.
    338                 if ( empty( $this->id_data[ 'keys' ] ) )
    339                         return set_theme_mod( $this->id_data[ 'base' ], $value );
    340 
     337                if ( empty( $this->id_data[ 'keys' ] ) ) {
     338                        set_theme_mod( $this->id_data[ 'base' ], $value );
     339                        return;
     340                }
    341341                // Handle array-based theme mod.
    342342                $mods = get_theme_mod( $this->id_data[ 'base' ] );
    343343                $mods = $this->multidimensional_replace( $mods, $this->id_data[ 'keys' ], $value );
    344                 if ( isset( $mods ) )
    345                         return set_theme_mod( $this->id_data[ 'base' ], $mods );
     344                if ( isset( $mods ) ) {
     345                        set_theme_mod( $this->id_data[ 'base' ], $mods );
     346                }
    346347        }
    347348
     
    352353         *
    353354         * @param mixed $value The value to update.
    354          * @return bool|null The result of saving the value.
     355         * @return bool The result of saving the value.
    355356         */
    356357        protected function _update_option( $value ) {
Note: See TracChangeset for help on using the changeset viewer.