Coding Standards: Fix WPCS issues in WP_Widget_Links
and WP_Widget_Pages
.
Props itowhid06. Fixes #48228. git-svn-id: https://develop.svn.wordpress.org/trunk@46415 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3a06234fe4
commit
a59b9dd39e
@ -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
|
||||
}
|
||||
|
@ -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';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user