Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (6 years ago)
Author:
SergeyBiryukov
Message:

General: Replace older-style PHP type conversion functions with type casts.

This improves performance, readability, and consistency throughout core.

  • intval()(int)
  • strval()(string)
  • floatval()(float)

Props ayeshrajans.
Fixes #42918.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r48991 r49108  
    9090                        )
    9191                );
    92                 $this->user_posts_count = intval(
    93                         $wpdb->get_var(
    94                                 $wpdb->prepare(
    95                                         "
     92                $this->user_posts_count = (int) $wpdb->get_var(
     93                        $wpdb->prepare(
     94                                "
    9695                        SELECT COUNT( 1 )
    9796                        FROM $wpdb->posts
     
    10099                        AND post_author = %d
    101100                ",
    102                                         $post_type,
    103                                         get_current_user_id()
    104                                 )
     101                                $post_type,
     102                                get_current_user_id()
    105103                        )
    106104                );
Note: See TracChangeset for help on using the changeset viewer.