diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-includes/widgets/class-wp-widget-links.php --- a/wp/wp-includes/widgets/class-wp-widget-links.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-includes/widgets/class-wp-widget-links.php Tue Dec 15 13:49:49 2020 +0100 @@ -45,7 +45,7 @@ $show_images = isset( $instance['images'] ) ? $instance['images'] : true; $category = isset( $instance['category'] ) ? $instance['category'] : false; $orderby = isset( $instance['orderby'] ) ? $instance['orderby'] : 'name'; - $order = $orderby == 'rating' ? 'DESC' : 'ASC'; + $order = 'rating' === $orderby ? 'DESC' : 'ASC'; $limit = isset( $instance['limit'] ) ? $instance['limit'] : -1; $before_widget = preg_replace( '/id="[^"]*"/', 'id="%id"', $args['before_widget'] ); @@ -105,7 +105,7 @@ } $instance['orderby'] = 'name'; - if ( in_array( $new_instance['orderby'], array( 'name', 'rating', 'id', 'rand' ) ) ) { + if ( in_array( $new_instance['orderby'], array( 'name', 'rating', 'id', 'rand' ), true ) ) { $instance['orderby'] = $new_instance['orderby']; } @@ -124,7 +124,7 @@ */ public function form( $instance ) { - //Defaults + // Defaults. $instance = wp_parse_args( (array) $instance, array( @@ -137,44 +137,51 @@ 'limit' => -1, ) ); - $link_cats = get_terms( 'link_category' ); - if ( ! $limit = intval( $instance['limit'] ) ) { + $link_cats = get_terms( array( 'taxonomy' => 'link_category' ) ); + $limit = intval( $instance['limit'] ); + if ( ! $limit ) { $limit = -1; } ?>
- - - - + + + +
+
- id="get_field_id( 'images' ); ?>" name="get_field_name( 'images' ); ?>" />
-
- id="get_field_id( 'name' ); ?>" name="get_field_name( 'name' ); ?>" />
-
- id="get_field_id( 'description' ); ?>" name="get_field_name( 'description' ); ?>" />
-
- id="get_field_id( 'rating' ); ?>" name="get_field_name( 'rating' ); ?>" />
-
+ id="get_field_id( 'images' ); ?>" name="get_field_name( 'images' ); ?>" />
+
+
+
+ id="get_field_id( 'name' ); ?>" name="get_field_name( 'name' ); ?>" />
+
+
+
+ id="get_field_id( 'description' ); ?>" name="get_field_name( 'description' ); ?>" />
+
+
+
+ id="get_field_id( 'rating' ); ?>" name="get_field_name( 'rating' ); ?>" />
+
- - + +