Coding Standards: Fix WPCS issues in `WP_Widget_Links` and `WP_Widget_Pages`.

Props itowhid06.
Fixes #48228.
Built from https://develop.svn.wordpress.org/trunk@46415


git-svn-id: http://core.svn.wordpress.org/trunk@46213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-10-06 15:28:03 +00:00
parent d54df2ffb3
commit 406dc81ebc
3 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-beta2-46414';
$wp_version = '5.3-beta2-46415';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -45,7 +45,7 @@ class WP_Widget_Links extends WP_Widget {
$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'] );
@ -175,7 +175,7 @@ class WP_Widget_Links extends WP_Widget {
</p>
<p>
<label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Number of links to show:' ); ?></label>
<input id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo $limit == -1 ? '' : intval( $limit ); ?>" size="3" />
<input id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo ( -1 !== $limit ) ? intval( $limit ) : ''; ?>" size="3" />
</p>
<?php
}

View File

@ -56,7 +56,7 @@ class WP_Widget_Pages extends WP_Widget {
$sortby = empty( $instance['sortby'] ) ? 'menu_order' : $instance['sortby'];
$exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude'];
if ( $sortby == 'menu_order' ) {
if ( 'menu_order' === $sortby ) {
$sortby = 'menu_order, post_title';
}