From aeb49fb7bee48c6441088736b3a408fde8f0cd85 Mon Sep 17 00:00:00 2001 From: duck_ Date: Wed, 2 Nov 2011 17:06:34 +0000 Subject: [PATCH] Return full WHERE clause from get_posts_by_author_sql() if the post type isn't registerd. Fixes SQL sytax on users list when 'post' is unregistered. Fixes #19116. git-svn-id: http://svn.automattic.com/wordpress/trunk@19117 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 19472912d..923d92ba7 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4150,7 +4150,7 @@ function get_posts_by_author_sql( $post_type, $full = true, $post_author = null // Private posts $post_type_obj = get_post_type_object( $post_type ); if ( ! $post_type_obj ) - return ' 1 = 0 '; + return $full ? 'WHERE 1 = 0' : ' 1 = 0 '; // This hook is deprecated. Why you'd want to use it, I dunno. if ( ! $cap = apply_filters( 'pub_priv_sql_capability', '' ) )