src/wp-admin/export.php | 10 ++++------
src/wp-includes/deprecated.php | 12 ++++--------
src/wp-includes/media.php | 10 ++++------
src/wp-includes/user.php | 16 ++++++----------
4 files changed, 18 insertions(+), 30 deletions(-)
diff --git a/src/wp-admin/export.php b/src/wp-admin/export.php
index 6e4c335190..7c59c9e6c0 100644
|
a
|
b
|
function export_date_options( $post_type = 'post' ) { |
| 141 | 141 | |
| 142 | 142 | $months = $wpdb->get_results( |
| 143 | 143 | $wpdb->prepare( |
| 144 | | " |
| 145 | | SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month |
| 146 | | FROM $wpdb->posts |
| 147 | | WHERE post_type = %s AND post_status != 'auto-draft' |
| 148 | | ORDER BY post_date DESC |
| 149 | | ", |
| | 144 | "SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month |
| | 145 | FROM $wpdb->posts |
| | 146 | WHERE post_type = %s AND post_status != 'auto-draft' |
| | 147 | ORDER BY post_date DESC", |
| 150 | 148 | $post_type |
| 151 | 149 | ) |
| 152 | 150 | ); |
diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php
index d2885ef497..f72cf4a4c0 100644
|
a
|
b
|
function get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' ) |
| 4562 | 4562 | $post_type = esc_sql( $post_type ); |
| 4563 | 4563 | $post_type_in_string = "'" . implode( "','", $post_type ) . "'"; |
| 4564 | 4564 | $sql = $wpdb->prepare( |
| 4565 | | " |
| 4566 | | SELECT ID |
| | 4565 | "SELECT ID |
| 4567 | 4566 | FROM $wpdb->posts |
| 4568 | 4567 | WHERE post_title = %s |
| 4569 | | AND post_type IN ($post_type_in_string) |
| 4570 | | ", |
| | 4568 | AND post_type IN ($post_type_in_string)", |
| 4571 | 4569 | $page_title |
| 4572 | 4570 | ); |
| 4573 | 4571 | } else { |
| 4574 | | $sql = $wpdb->prepare( |
| 4575 | | " |
| | 4572 | $sql = $wpdb->prepare(" |
| 4576 | 4573 | SELECT ID |
| 4577 | 4574 | FROM $wpdb->posts |
| 4578 | 4575 | WHERE post_title = %s |
| 4579 | | AND post_type = %s |
| 4580 | | ", |
| | 4576 | AND post_type = %s", |
| 4581 | 4577 | $page_title, |
| 4582 | 4578 | $post_type |
| 4583 | 4579 | ); |
diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
index 27dd4dfb3a..ccc7ac1aa5 100644
|
a
|
b
|
function wp_enqueue_media( $args = array() ) { |
| 4543 | 4543 | if ( ! is_array( $months ) ) { |
| 4544 | 4544 | $months = $wpdb->get_results( |
| 4545 | 4545 | $wpdb->prepare( |
| 4546 | | " |
| 4547 | | SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month |
| 4548 | | FROM $wpdb->posts |
| 4549 | | WHERE post_type = %s |
| 4550 | | ORDER BY post_date DESC |
| 4551 | | ", |
| | 4546 | "SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month |
| | 4547 | FROM $wpdb->posts |
| | 4548 | WHERE post_type = %s |
| | 4549 | ORDER BY post_date DESC", |
| 4552 | 4550 | 'attachment' |
| 4553 | 4551 | ) |
| 4554 | 4552 | ); |
diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
index 0669a052d0..87ff6543e0 100644
|
a
|
b
|
function count_users( $strategy = 'time', $site_id = null ) { |
| 1268 | 1268 | |
| 1269 | 1269 | // Add the meta_value index to the selection list, then run the query. |
| 1270 | 1270 | $row = $wpdb->get_row( |
| 1271 | | " |
| 1272 | | SELECT {$select_count}, COUNT(*) |
| | 1271 | "SELECT {$select_count}, COUNT(*) |
| 1273 | 1272 | FROM {$wpdb->usermeta} |
| 1274 | 1273 | INNER JOIN {$wpdb->users} ON user_id = ID |
| 1275 | | WHERE meta_key = '{$blog_prefix}capabilities' |
| 1276 | | ", |
| | 1274 | WHERE meta_key = '{$blog_prefix}capabilities'", |
| 1277 | 1275 | ARRAY_N |
| 1278 | 1276 | ); |
| 1279 | 1277 | |
| … |
… |
function wp_get_users_with_no_role( $site_id = null ) { |
| 3545 | 3543 | $regex = preg_replace( '/[^a-zA-Z_\|-]/', '', $regex ); |
| 3546 | 3544 | $users = $wpdb->get_col( |
| 3547 | 3545 | $wpdb->prepare( |
| 3548 | | " |
| 3549 | | SELECT user_id |
| 3550 | | FROM $wpdb->usermeta |
| 3551 | | WHERE meta_key = '{$prefix}capabilities' |
| 3552 | | AND meta_value NOT REGEXP %s |
| 3553 | | ", |
| | 3546 | "SELECT user_id |
| | 3547 | FROM $wpdb->usermeta |
| | 3548 | WHERE meta_key = '{$prefix}capabilities' |
| | 3549 | AND meta_value NOT REGEXP %s", |
| 3554 | 3550 | $regex |
| 3555 | 3551 | ) |
| 3556 | 3552 | ); |