Burada:
https://wordpress.stackexchange.com/...ustom-taxonomy bir kod var belli kategoriye yönelik.
Burada:
https://wordpress.org/support/topic/...or-a-taxonomy/ functions için kod var fakat nasıl kullanacağımı bilemiyorum. Yani functions.php ye ekleyeceğim ama sonucu nasıl verecek çözemedim.
function posts_with_empty_tax($query) {
/*** SET THESE THINGS BEFORE USING ***/
//return; // comment this out to use the function
$posttype_to_check = 'post'; // set to desired post type: post or guideline
$tax_to_check = 'issue'; // set to desired taxonomy: issue, article_author, guideline_topic (maybe tag???)
$user_checking = 'redacted'; // set to yourself
if (!is_admin()) return;
if ($query->get('post_type') != $posttype_to_check) return;
$user = wp_get_current_user();
if ($user->user_login != $user_checking) return;
$tax_query = array(array(
'taxonomy' => $tax_to_check,
'operator' => 'NOT EXISTS',
));
$query->set( 'tax_query', $tax_query );
}
add_action( 'pre_get_posts', 'posts_with_empty_tax' );