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

    r51850 r53450  
    99/** WordPress Administration Bootstrap */
    1010require_once __DIR__ . '/admin.php';
     11
     12/**
     13 * @global string $typenow The post type of the current screen.
     14 */
     15global $typenow;
    1116
    1217if ( ! $typenow ) {
     
    8893        // Validate the post status exists.
    8994        if ( get_post_status_object( $post_status ) ) {
     95            /**
     96             * @global wpdb $wpdb WordPress database abstraction object.
     97             */
     98            global $wpdb;
     99
    90100            $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) );
    91101        }
Note: See TracChangeset for help on using the changeset viewer.