Customize: Clean up docs and code style for customize changes in 4.7.

* Adds missing `resolve`/`fail` for promise returned by `loadThemePreview`.
* Adds missing jsdoc blocks and tags.
* Adds missing phpdoc and makes corrections.

See #37770.
Fixes #38908.

Built from https://develop.svn.wordpress.org/trunk@39345


git-svn-id: http://core.svn.wordpress.org/trunk@39285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter
2016-11-23 06:05:32 +00:00
parent e20ded7e75
commit 6b5d960453
11 changed files with 125 additions and 34 deletions

View File

@@ -119,7 +119,7 @@ class WP_Customize_Control {
*
* @since 4.7.0
* @access public
* @var array
* @var bool
*/
public $allow_addition = false;

View File

@@ -3967,27 +3967,27 @@ final class WP_Customize_Manager {
if ( ! in_array( $value, array( 'repeat-x', 'repeat-y', 'repeat', 'no-repeat' ) ) ) {
return new WP_Error( 'invalid_value', __( 'Invalid value for background repeat.' ) );
}
} else if ( 'background_attachment' === $setting->id ) {
} elseif ( 'background_attachment' === $setting->id ) {
if ( ! in_array( $value, array( 'fixed', 'scroll' ) ) ) {
return new WP_Error( 'invalid_value', __( 'Invalid value for background attachment.' ) );
}
} else if ( 'background_position_x' === $setting->id ) {
} elseif ( 'background_position_x' === $setting->id ) {
if ( ! in_array( $value, array( 'left', 'center', 'right' ), true ) ) {
return new WP_Error( 'invalid_value', __( 'Invalid value for background position X.' ) );
}
} else if ( 'background_position_y' === $setting->id ) {
} elseif ( 'background_position_y' === $setting->id ) {
if ( ! in_array( $value, array( 'top', 'center', 'bottom' ), true ) ) {
return new WP_Error( 'invalid_value', __( 'Invalid value for background position Y.' ) );
}
} else if ( 'background_size' === $setting->id ) {
} elseif ( 'background_size' === $setting->id ) {
if ( ! in_array( $value, array( 'auto', 'contain', 'cover' ), true ) ) {
return new WP_Error( 'invalid_value', __( 'Invalid value for background size.' ) );
}
} else if ( 'background_preset' === $setting->id ) {
} elseif ( 'background_preset' === $setting->id ) {
if ( ! in_array( $value, array( 'default', 'fill', 'fit', 'repeat', 'custom' ), true ) ) {
return new WP_Error( 'invalid_value', __( 'Invalid value for background size.' ) );
}
} else if ( 'background_image' === $setting->id || 'background_image_thumb' === $setting->id ) {
} elseif ( 'background_image' === $setting->id || 'background_image_thumb' === $setting->id ) {
$value = empty( $value ) ? '' : esc_url_raw( $value );
} else {
return new WP_Error( 'unrecognized_setting', __( 'Unrecognized background setting.' ) );

View File

@@ -16,21 +16,28 @@
*/
class WP_Customize_Color_Control extends WP_Customize_Control {
/**
* Type.
*
* @access public
* @var string
*/
public $type = 'color';
/**
* Statuses.
*
* @access public
* @var array
*/
public $statuses;
/**
* @access public
* @var string
*/
* Mode.
*
* @since 4.7.0
* @access public
* @var string
*/
public $mode = 'full';
/**

View File

@@ -21,10 +21,9 @@ final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting {
/**
* The setting type.
*
* @var string
*
* @since 4.7.0
* @access public
* @var string
*/
public $type = 'custom_css';
@@ -33,7 +32,6 @@ final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting {
*
* @since 4.7.0
* @access public
*
* @var string
*/
public $transport = 'postMessage';
@@ -43,7 +41,6 @@ final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting {
*
* @since 4.7.0
* @access public
*
* @var string
*/
public $capability = 'edit_css';
@@ -53,7 +50,6 @@ final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting {
*
* @since 4.7.0
* @access public
*
* @var string
*/
public $stylesheet = '';

View File

@@ -267,6 +267,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
* Get original title.
*
* @since 4.7.0
* @access protected
*
* @param object $item Nav menu item.
* @return string The original title.

View File

@@ -132,6 +132,7 @@
* Handle link clicks in preview.
*
* @since 4.7.0
* @access public
*
* @param {jQuery.Event} event Event.
*/
@@ -178,6 +179,7 @@
* Handle form submit.
*
* @since 4.7.0
* @access public
*
* @param {jQuery.Event} event Event.
*/

View File

@@ -104,6 +104,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* Create and show the edit shortcut for a given partial placement container.
*
* @since 4.7.0
* @access public
*
* @param {Placement} placement The placement container element.
* @returns {void}
@@ -132,6 +133,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* Add an edit shortcut to the placement container.
*
* @since 4.7.0
* @access public
*
* @param {Placement} placement The placement for the partial.
* @param {jQuery} $editShortcut The shortcut element as a jQuery object.
@@ -149,6 +151,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* Return the unique class name for the edit shortcut button for this partial.
*
* @since 4.7.0
* @access public
*
* @return {string} Partial ID converted into a class name for use in shortcut.
*/
@@ -162,6 +165,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* Return the appropriate translated string for the edit shortcut button.
*
* @since 4.7.0
* @access public
*
* @return {string} Tooltip for edit shortcut.
*/
@@ -187,6 +191,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* Will use `params.type` if set, but otherwise will try to infer type from settingId.
*
* @since 4.7.0
* @access public
*
* @return {string} Type of partial derived from type param or the related setting ID.
*/
@@ -209,6 +214,7 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* Create an edit shortcut button for this partial.
*
* @since 4.7.0
* @access public
*
* @return {jQuery} The edit shortcut button element.
*/

View File

@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-beta4-39344';
$wp_version = '4.7-beta4-39345';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.