mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-03 14:17:06 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@53450 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -9,6 +9,11 @@
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once __DIR__ . '/admin.php';
|
||||
|
||||
/**
|
||||
* @global string $typenow The post type of the current screen.
|
||||
*/
|
||||
global $typenow;
|
||||
|
||||
if ( ! $typenow ) {
|
||||
wp_die( __( 'Invalid post type.' ) );
|
||||
}
|
||||
@@ -87,6 +92,11 @@ if ( $doaction ) {
|
||||
$post_status = preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['post_status'] );
|
||||
// Validate the post status exists.
|
||||
if ( get_post_status_object( $post_status ) ) {
|
||||
/**
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
*/
|
||||
global $wpdb;
|
||||
|
||||
$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) );
|
||||
}
|
||||
$doaction = 'delete';
|
||||
|
||||
Reference in New Issue
Block a user