WordPress.org

Make WordPress Core

Changeset 46415


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

Coding Standards: Fix WPCS issues in WP_Widget_Links and WP_Widget_Pages.

Props itowhid06.
Fixes #48228.

Location:
trunk/src/wp-includes/widgets
Files:
2 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
  • trunk/src/wp-includes/widgets/class-wp-widget-pages.php

    r43571 r46415  
    5757        $exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude'];
    5858
    59         if ( $sortby == 'menu_order' ) {
     59        if ( 'menu_order' === $sortby ) {
    6060            $sortby = 'menu_order, post_title';
    6161        }
Note: See TracChangeset for help on using the changeset viewer.