Make WordPress Core


Ignore:
Timestamp:
10/06/2019 03:26:42 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Fix WPCS issues in WP_Widget_Links and WP_Widget_Pages.

Props itowhid06.
Fixes #48228.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-links.php

    r45723 r46415  
    4646        $category         = isset( $instance['category'] ) ? $instance['category'] : false;
    4747        $orderby          = isset( $instance['orderby'] ) ? $instance['orderby'] : 'name';
    48         $order            = $orderby == 'rating' ? 'DESC' : 'ASC';
     48        $order            = 'rating' === $orderby ? 'DESC' : 'ASC';
    4949        $limit            = isset( $instance['limit'] ) ? $instance['limit'] : -1;
    5050
     
    176176        <p>
    177177        <label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Number of links to show:' ); ?></label>
    178         <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" />
     178        <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" />
    179179        </p>
    180180        <?php
Note: See TracChangeset for help on using the changeset viewer.