From 848a678861b4f6796ae31795b26eff013cd7559a Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 14 Jun 2021 15:15:26 +0000 Subject: [PATCH] Docs: Update documentation for some `WP_Customize_Widgets` methods per the documentation standards. * Add missing `@since` tags for the `$id_base` parameter of ::sanitize_widget_instance()` and `::sanitize_widget_js_instance()`. * Document the usage of `$wp_widget_factory` global in `::sanitize_widget_instance()`. * Use multi-line comment syntax for a comment in `::enqueue_scripts()`. Follow-up to [50996], [51141]. See #52628. git-svn-id: https://develop.svn.wordpress.org/trunk@51142 602fd350-edb4-49c9-b593-d223f7449a82 --- .../class-wp-customize-widgets.php | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php index 68efa5cf8a..37cb8aca28 100644 --- a/src/wp-includes/class-wp-customize-widgets.php +++ b/src/wp-includes/class-wp-customize-widgets.php @@ -828,9 +828,11 @@ final class WP_Customize_Widgets { sprintf( 'var _wpCustomizeWidgetsSettings = %s;', wp_json_encode( $settings ) ) ); - // TODO: Update 'wp-customize-widgets' to not rely so much on things in - // 'customize-widgets'. This will let us skip most of the above and not - // enqueue 'customize-widgets' which saves bytes. + /* + * TODO: Update 'wp-customize-widgets' to not rely so much on things in + * 'customize-widgets'. This will let us skip most of the above and not + * enqueue 'customize-widgets' which saves bytes. + */ if ( wp_use_widgets_block_editor() ) { $block_editor_context = new WP_Block_Editor_Context(); @@ -1394,11 +1396,12 @@ final class WP_Customize_Widgets { * only get applied to an instance *once*. * * @since 3.9.0 + * @since 5.8.0 Added the `$id_base` parameter. * * @global WP_Widget_Factory $wp_widget_factory * - * @param array $value Widget instance to sanitize. - * @param string $id_base Base of the ID of the widget being sanitized. + * @param array $value Widget instance to sanitize. + * @param string $id_base Optional. Base of the ID of the widget being sanitized. Default null. * @return array|void Sanitized widget instance. */ public function sanitize_widget_instance( $value, $id_base = null ) { @@ -1444,9 +1447,12 @@ final class WP_Customize_Widgets { * Converts a widget instance into JSON-representable format. * * @since 3.9.0 + * @since 5.8.0 Added the `$id_base` parameter. * - * @param array $value Widget instance to convert to JSON. - * @param string $id_base Base of the ID of the widget being sanitized. + * @global WP_Widget_Factory $wp_widget_factory + * + * @param array $value Widget instance to convert to JSON. + * @param string $id_base Optional. Base of the ID of the widget being sanitized. Default null. * @return array JSON-converted widget instance. */ public function sanitize_widget_js_instance( $value, $id_base = null ) {