Prepare DB queries in more places. Props filosofo. see #6644

git-svn-id: http://svn.automattic.com/wordpress/trunk@7645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-04-14 16:13:25 +00:00
parent 796ae7104e
commit 248a0c06e2
24 changed files with 153 additions and 166 deletions

View File

@@ -892,7 +892,7 @@ function page_template_dropdown( $default = '' ) {
function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
global $wpdb, $post_ID;
$items = $wpdb->get_results( "SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = $parent AND post_type = 'page' ORDER BY menu_order" );
$items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) );
if ( $items ) {
foreach ( $items as $item ) {