Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (4 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/dashboard.php

    r48991 r49108  
    607607
    608608    /* translators: Maximum number of words used in a preview of a draft on the dashboard. */
    609     $draft_length = intval( _x( '10', 'draft_length' ) );
     609    $draft_length = (int) _x( '10', 'draft_length' );
    610610
    611611    $drafts = array_slice( $drafts, 0, 3 );
     
    929929        'orderby'        => 'date',
    930930        'order'          => $args['order'],
    931         'posts_per_page' => intval( $args['max'] ),
     931        'posts_per_page' => (int) $args['max'],
    932932        'no_found_rows'  => true,
    933933        'cache_results'  => false,
Note: See TracChangeset for help on using the changeset viewer.