I would flag post as member_post
when it is submitted to database and use this flag to sort them.
function wpse_287048_flag_member_post( $post_id ) {
if ( wc_memberships_get_user_active_memberships() !== false ) { // Check if user is member
update_post_meta( $post_id, 'member_post', 1 );
} else {
update_post_meta( $post_id, 'member_post', 0 );
}
}
add_action( 'save_post', 'wpse_287048_flag_member_post' );
Then you are free to retrive your post sorted by member_post
.
function wpse_287048_get_posts() {
$query = new WP_Query(array(
'post_type' => 'post',
'meta_key' => 'member_post',
'orderby' => 'meta_value_num post_date',
));
return $query->get_posts();
}
Keep in my mind that all posts which you want to retrive must have member_post
meta_key with some value otherwise they would not be selected from database.