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: https://develop.svn.wordpress.org/trunk@19117 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fa570e7b76
commit
479b59bdb0
|
@ -4150,7 +4150,7 @@ function get_posts_by_author_sql( $post_type, $full = true, $post_author = null
|
||||||
// Private posts
|
// Private posts
|
||||||
$post_type_obj = get_post_type_object( $post_type );
|
$post_type_obj = get_post_type_object( $post_type );
|
||||||
if ( ! $post_type_obj )
|
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.
|
// This hook is deprecated. Why you'd want to use it, I dunno.
|
||||||
if ( ! $cap = apply_filters( 'pub_priv_sql_capability', '' ) )
|
if ( ! $cap = apply_filters( 'pub_priv_sql_capability', '' ) )
|
||||||
|
|
Loading…
Reference in New Issue