Your setup isn’t supported by WP_Query
.
One approach is to use the posts_where
filter of WP_Query
(there are other ways possible, like collecting post ID’s instead from different queries.) to adjust the SQL query.
To avoid string replaces we could use for example:
$custom_query_args = [
'post_type' => 'post',
'post_status' => 'publish',
];
// Add filter
add_filter( 'posts_where', 'wpse_where' );
// Query
$custom_query = new WP_Query( $custom_query_args );
// Remove filter
remove_filter( 'posts_where', 'wpse_where' );
where our custom filter callback is:
function wpse_where( $where )
{
global $wpdb;
return $where . " OR (
{wpdb->posts}.post_author = 2
AND {wpdb->posts}.post_status="publish"
AND {wpdb->posts}.post_type="post"
) ";
}
Hopefully you can adjust this to your needs.