mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 19:54:28 +00:00
Coding Standards: Improve formatting of some SQL queries for better readability.
This corrects the placement of double quotes around the query and makes sure the alignment is consistent. Props umeshmcakadi, mukesh27, krupalpanchal, dhrumilk, SergeyBiryukov. Fixes #58372. git-svn-id: https://develop.svn.wordpress.org/trunk@55857 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -4562,22 +4562,18 @@ function get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' )
|
||||
$post_type = esc_sql( $post_type );
|
||||
$post_type_in_string = "'" . implode( "','", $post_type ) . "'";
|
||||
$sql = $wpdb->prepare(
|
||||
"
|
||||
SELECT ID
|
||||
"SELECT ID
|
||||
FROM $wpdb->posts
|
||||
WHERE post_title = %s
|
||||
AND post_type IN ($post_type_in_string)
|
||||
",
|
||||
AND post_type IN ($post_type_in_string)",
|
||||
$page_title
|
||||
);
|
||||
} else {
|
||||
$sql = $wpdb->prepare(
|
||||
"
|
||||
SELECT ID
|
||||
"SELECT ID
|
||||
FROM $wpdb->posts
|
||||
WHERE post_title = %s
|
||||
AND post_type = %s
|
||||
",
|
||||
AND post_type = %s",
|
||||
$page_title,
|
||||
$post_type
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user