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-comments-post.php

    r48574 r49108  
    2525$comment = wp_handle_comment_submission( wp_unslash( $_POST ) );
    2626if ( is_wp_error( $comment ) ) {
    27     $data = intval( $comment->get_error_data() );
     27    $data = (int) $comment->get_error_data();
    2828    if ( ! empty( $data ) ) {
    2929        wp_die(
Note: See TracChangeset for help on using the changeset viewer.