Make WordPress Core


Ignore:
Timestamp:
05/29/2022 03:33:12 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Explicitly declare some globals for clarity.

This aims to improve developer experience by making it clear that these variables are defined elsewhere.

Props ravipatel, davidbaumwald, hellofromTonya, costdev, SergeyBiryukov.
Fixes #51439.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-comments.php

    r51975 r53450  
    2626
    2727    if ( 'delete_all' === $doaction && ! empty( $_REQUEST['pagegen_timestamp'] ) ) {
     28        /**
     29         * @global wpdb $wpdb WordPress database abstraction object.
     30         */
     31        global $wpdb;
     32
    2833        $comment_status = wp_unslash( $_REQUEST['comment_status'] );
    2934        $delete_time    = wp_unslash( $_REQUEST['pagegen_timestamp'] );
     
    135140wp_enqueue_script( 'admin-comments' );
    136141enqueue_comment_hotkeys_js();
     142
     143/**
     144 * @global int $post_id
     145 */
     146global $post_id;
    137147
    138148if ( $post_id ) {
Note: See TracChangeset for help on using the changeset viewer.