Make WordPress Core


Ignore:
Timestamp:
03/21/2021 12:39:25 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison for return type checks in a few functions:

  • get_bookmark()
  • get_comment()
  • get_post()
  • get_children()
  • wp_get_recent_posts()
  • wp_get_post_revision()
  • wp_get_nav_menu_items()

Follow-up to [45710] for get_term(), [48507] for wpdb::get_row() and wpdb::get_results().

See #52627.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment.php

    r50533 r50558  
    219219    $_comment = apply_filters( 'get_comment', $_comment );
    220220
    221     if ( OBJECT == $output ) {
     221    if ( OBJECT === $output ) {
    222222        return $_comment;
    223     } elseif ( ARRAY_A == $output ) {
     223    } elseif ( ARRAY_A === $output ) {
    224224        return $_comment->to_array();
    225     } elseif ( ARRAY_N == $output ) {
     225    } elseif ( ARRAY_N === $output ) {
    226226        return array_values( $_comment->to_array() );
    227227    }
Note: See TracChangeset for help on using the changeset viewer.