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.


git-svn-id: https://develop.svn.wordpress.org/trunk@32535 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-05-21 22:04:29 +00:00
parent 369903cd85
commit 9333337992
5 changed files with 36 additions and 27 deletions

View File

@@ -133,7 +133,7 @@ class WP_Customize_Setting {
*/
public function is_current_blog_previewed() {
if ( ! isset( $this->_previewed_blog_id ) ) {
return null;
return;
}
return ( get_current_blog_id() === $this->_previewed_blog_id );
}
@@ -275,8 +275,8 @@ class WP_Customize_Setting {
*
* @since 3.4.0
*
* @param mixed $value The value to sanitize.
* @return mixed Null if an input isn't valid, otherwise the sanitized value.
* @param string|array $value The value to sanitize.
* @return string|array|null Null if an input isn't valid, otherwise the sanitized value.
*/
public function sanitize( $value ) {
$value = wp_unslash( $value );
@@ -331,18 +331,19 @@ class WP_Customize_Setting {
* @since 3.4.0
*
* @param mixed $value The value to update.
* @return mixed The result of saving the value.
*/
protected function _update_theme_mod( $value ) {
// Handle non-array theme mod.
if ( empty( $this->id_data[ 'keys' ] ) )
return set_theme_mod( $this->id_data[ 'base' ], $value );
if ( empty( $this->id_data[ 'keys' ] ) ) {
set_theme_mod( $this->id_data[ 'base' ], $value );
return;
}
// Handle array-based theme mod.
$mods = get_theme_mod( $this->id_data[ 'base' ] );
$mods = $this->multidimensional_replace( $mods, $this->id_data[ 'keys' ], $value );
if ( isset( $mods ) )
return set_theme_mod( $this->id_data[ 'base' ], $mods );
if ( isset( $mods ) ) {
set_theme_mod( $this->id_data[ 'base' ], $mods );
}
}
/**
@@ -351,7 +352,7 @@ class WP_Customize_Setting {
* @since 3.4.0
*
* @param mixed $value The value to update.
* @return bool|null The result of saving the value.
* @return bool The result of saving the value.
*/
protected function _update_option( $value ) {
// Handle non-array option.