diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-includes/widgets/class-wp-widget-media.php --- a/wp/wp-includes/widgets/class-wp-widget-media.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-includes/widgets/class-wp-widget-media.php Tue Dec 15 13:49:49 2020 +0100 @@ -72,11 +72,11 @@ 'edit_media' => _x( 'Edit Media', 'label for button in the media widget; should preferably not be longer than ~13 characters long' ), 'add_to_widget' => __( 'Add to Widget' ), 'missing_attachment' => sprintf( - /* translators: %s: URL to media library */ + /* translators: %s: URL to media library. */ __( 'We can’t find that file. Check your media library and make sure it wasn’t deleted.' ), esc_url( admin_url( 'upload.php' ) ) ), - /* translators: %d: widget count */ + /* translators: %d: Widget count. */ 'media_library_state_multi' => _n_noop( 'Media Widget (%d)', 'Media Widget (%d)' ), 'media_library_state_single' => __( 'Media Widget' ), 'unsupported_file_type' => __( 'Looks like this isn’t the correct kind of file. Please link to an appropriate file instead.' ), @@ -106,14 +106,16 @@ } $this->registered = true; - // Note that the widgets component in the customizer will also do the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts(). + // Note that the widgets component in the customizer will also do + // the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts(). add_action( 'admin_print_scripts-widgets.php', array( $this, 'enqueue_admin_scripts' ) ); if ( $this->is_preview() ) { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_preview_scripts' ) ); } - // Note that the widgets component in the customizer will also do the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts(). + // Note that the widgets component in the customizer will also do + // the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts(). add_action( 'admin_footer-widgets.php', array( $this, 'render_control_template_scripts' ) ); add_filter( 'display_media_states', array( $this, 'display_media_state' ), 10, 2 ); @@ -127,6 +129,7 @@ * @see WP_REST_Controller::get_item_schema() * @see WP_REST_Controller::get_additional_fields() * @link https://core.trac.wordpress.org/ticket/35574 + * * @return array Schema for properties. */ public function get_instance_schema() { @@ -273,7 +276,10 @@ } $value = $new_instance[ $field ]; - // Workaround for rest_validate_value_from_schema() due to the fact that rest_is_boolean( '' ) === false, while rest_is_boolean( '1' ) is true. + /* + * Workaround for rest_validate_value_from_schema() due to the fact that + * rest_is_boolean( '' ) === false, while rest_is_boolean( '1' ) is true. + */ if ( 'boolean' === $field_schema['type'] && '' === $value ) { $value = false; } @@ -320,8 +326,8 @@ * @since 4.8.0 * * @see \WP_Widget_Media::render_control_template_scripts() Where the JS template is located. + * * @param array $instance Current settings. - * @return void */ final public function form( $instance ) { $instance_schema = $this->get_instance_schema();