Skip to content
Permalink
Browse files

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
  • Loading branch information...
SergeyBiryukov committed Oct 6, 2019
1 parent 3a06234 commit a59b9dd39ec95c260a36bc5e5d5187a3b5e50b6c
@@ -45,7 +45,7 @@ public function widget( $args, $instance ) {
$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 @@ public function form( $instance ) {
</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 @@ public function widget( $args, $instance ) {
$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';
}

0 comments on commit a59b9dd

Please sign in to comment.
You can’t perform that action at this time.