Make WordPress Core

Ticket #51439: 51439.diff

File 51439.diff, 4.4 KB (added by SergeyBiryukov, 3 years ago)
  • src/wp-admin/edit-comments.php

     
    2525        check_admin_referer( 'bulk-comments' );
    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'] );
    3035                $comment_ids    = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s AND %s > comment_date_gmt", $comment_status, $delete_time ) );
     
    135140wp_enqueue_script( 'admin-comments' );
    136141enqueue_comment_hotkeys_js();
    137142
     143/**
     144 * @global int $post_id
     145 */
     146global $post_id;
     147
    138148if ( $post_id ) {
    139149        $comments_count      = wp_count_comments( $post_id );
    140150        $draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' );
  • src/wp-admin/edit-form-comment.php

     
    1010if ( ! defined( 'ABSPATH' ) ) {
    1111        die( '-1' );
    1212}
     13
     14/**
     15 * @global WP_Comment $comment Global comment object.
     16 */
     17global $comment;
    1318?>
    1419<form name="post" action="comment.php" method="post" id="post">
    1520<?php wp_nonce_field( 'update-comment_' . $comment->comment_ID ); ?>
     
    139144<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
    140145<fieldset id='timestampdiv' class='hide-if-js'>
    141146<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
    142 <?php touch_time( ( 'editcomment' === $action ), 0 ); ?>
     147<?php
     148/**
     149 * @global string $action
     150 */
     151global $action;
     152
     153touch_time( ( 'editcomment' === $action ), 0 );
     154?>
    143155</fieldset>
    144156</div>
    145157
  • src/wp-admin/edit.php

     
    99/** WordPress Administration Bootstrap */
    1010require_once __DIR__ . '/admin.php';
    1111
     12/**
     13 * @global string $typenow
     14 */
     15global $typenow;
     16
    1217if ( ! $typenow ) {
    1318        wp_die( __( 'Invalid post type.' ) );
    1419}
     
    8792                $post_status = preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['post_status'] );
    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                }
    92102                $doaction = 'delete';
  • src/wp-admin/install.php

     
    225225 * @global string $wp_version             The WordPress version string.
    226226 * @global string $required_php_version   The required PHP version string.
    227227 * @global string $required_mysql_version The required MySQL version string.
     228 * @global wpdb   $wpdb                   WordPress database abstraction object.
    228229 */
    229 global $wp_version, $required_php_version, $required_mysql_version;
     230global $wp_version, $required_php_version, $required_mysql_version, $wpdb;
    230231
    231232$php_version   = phpversion();
    232233$mysql_version = $wpdb->db_version();
  • src/wp-admin/upgrade.php

     
    3939 * @global string $wp_version             The WordPress version string.
    4040 * @global string $required_php_version   The required PHP version string.
    4141 * @global string $required_mysql_version The required MySQL version string.
     42 * @global wpdb   $wpdb                   WordPress database abstraction object.
    4243 */
    43 global $wp_version, $required_php_version, $required_mysql_version;
     44global $wp_version, $required_php_version, $required_mysql_version, $wpdb;
    4445
    4546$step = (int) $step;
    4647