为什么不这样做呢?
$fav_author_list = get_user_option( \'favorite-authors\', fav_authors_get_user_id() );
$fav_category_list = get_user_option( \'favorite-categories\', fav_categories_get_user_id() );
if(!empty($fav_author_list) && !empty($fav_category_list)) {
$rm_args = array(
\'posts_per_page\' => -1,
\'author__in\'=> $fav_author_list,
\'category__in\'=> $fav_category_list,
\'post_type\' => \'post\'
);
} elseif(!empty($fav_author_list) && empty($fav_category_list)) {
$rm_args = array(
\'posts_per_page\' => -1,
\'author__in\'=> $fav_author_list,
\'post_type\' => \'post\'
);
} elseif(empty($fav_author_list) && !empty($fav_category_list)) {
$rm_args = array(
\'posts_per_page\' => -1,
\'category__in\'=> $fav_category_list,
\'post_type\' => \'post\'
);
} else {
$rm_args = \'\'; // No args, because nothing to display.
}
if(!empty($rm_args)) {
$rm_blog = new WP_Query($rm_args);
if($rm_blog->have_posts()) : while ($rm_blog->have_posts()) : $rm_blog->the_post();
// Stuff here.
}