Mhh... Das man nur ne bestimmte Zeit lang Editieren darf ist unschön.
ok...
bin nen schritt weiter, aber klappen will es trotzdem noch ned:
PHP
add_action('pre_get_posts', 'show_only_tax' );
function show_only_tax($wp_query) {
$args = new WP_Tax_Query(
array('relation' => 'AND',
'queries' => array(
'taxonomy' => 'testartikel',
'field' => 'slug',
'terms' => 'action',
'include_children' => 0,
'operator' => 'IN'
)
)
);
$wp_query->tax_query = $args;
return $wp_query;
}
Alles anzeigen
print_r ausgabe von $wp_query:
PHP
WP_Query Object
(
[query_vars] => Array
(
[post_type] => post
[posts_per_page] => 20
[error] =>
[m] => 0
[p] => 0
[post_parent] =>
[subpost] =>
[subpost_id] =>
[attachment] =>
[attachment_id] => 0
[name] =>
[static] =>
[pagename] =>
[page_id] => 0
[second] =>
[minute] =>
[hour] =>
[day] => 0
[monthnum] => 0
[year] => 0
[w] => 0
[category_name] =>
[tag] =>
[cat] =>
[tag_id] =>
[author_name] =>
[feed] =>
[tb] =>
[paged] => 0
[comments_popup] =>
[meta_key] =>
[meta_value] =>
[preview] =>
[s] =>
[sentence] =>
[fields] =>
[category__in] => Array
(
)
[category__not_in] => Array
(
)
[category__and] => Array
(
)
[post__in] => Array
(
)
[post__not_in] => Array
(
)
[tag__in] => Array
(
)
[tag__not_in] => Array
(
)
[tag__and] => Array
(
)
[tag_slug__in] => Array
(
)
[tag_slug__and] => Array
(
)
)
[tax_query] => WP_Tax_Query Object
(
[queries] => Array
(
[0] => Array
(
[taxonomy] => testartikel
[terms] => Array
(
[0] => 'action'
)
[include_children] => 0
[field] => slug
[operator] => IN
)
)
[relation] => AND
)
[meta_query] =>
[post_count] => 0
[current_post] => -1
[in_the_loop] =>
[comment_count] => 0
[current_comment] => -1
[found_posts] => 0
[max_num_pages] => 0
[max_num_comment_pages] => 0
[is_single] =>
[is_preview] =>
[is_page] =>
[is_archive] =>
[is_date] =>
[is_year] =>
[is_month] =>
[is_day] =>
[is_time] =>
[is_author] =>
[is_category] =>
[is_tag] =>
[is_tax] => testartikel
[is_search] =>
[is_feed] =>
[is_comment_feed] =>
[is_trackback] =>
[is_home] =>
[is_404] =>
[is_comments_popup] =>
[is_paged] =>
[is_admin] => 1
[is_attachment] =>
[is_singular] =>
[is_robots] =>
[is_posts_page] =>
[is_post_type_archive] =>
[query_vars_hash] => 48c46087985fd587aa83fbdfdc78c891
[query_vars_changed] =>
[thumbnails_cached] =>
[query] => Array
(
[post_type] => post
[posts_per_page] => 20
)
)
Alles anzeigen