You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for great tool, I'm haivng difficulties in generating simple admin filter based on post_tag taxonomy that I want to share across all my CPT's. Here is my news CPT:
<?phpadd_action( 'init', function() {
register_extended_post_type( 'news', [
# Add the post type to the site's main RSS feed:'show_in_feed' => true,
'has_archive' => true,
'hierarchical' => false,
# Add the post type to the 'Recently Published' section of the dashboard:'dashboard_activity' => true,
# Add some custom columns to the admin screen:'admin_cols' => [
'product_featured_image' => [
'title' => 'Obrazek',
'featured_image' => 'thumbnail'
],
'tags' => [
'taxonomy' => 'post_tag'
],
'ordering' => array(
'title' => 'Kolejność przy wyróżnieniu',
'meta_key' => 'ordering',
),
'featured' => array(
'title' => 'Czy wyróżnione?',
'meta_key' => 'featured',
),
],
# Add some dropdown filters to the admin screen:'admin_filters' => [
'tags' => [
'taxonomy' => 'post_tag',
],
'featured' => array(
'title' => 'Czy wyróżnione?',
'meta_key' => 'featured',
),
],
], [
# Override the base names used for labels:'singular' => 'Aktualność',
'plural' => 'Aktualności',
'slug' => 'aktualnosci',
] );
register_taxonomy_for_object_type('post_tag', 'news');
} );
On admin panel I get basically what I want, but the problem is with default value of tag= when I pick show "all" tags, it's equal to =0 not empty string:
Hi, thanks for great tool, I'm haivng difficulties in generating simple admin filter based on post_tag taxonomy that I want to share across all my CPT's. Here is my news CPT:
On admin panel I get basically what I want, but the problem is with default value of tag= when I pick show "all" tags, it's equal to =0 not empty string:
So as a result any query through fillters that do not have tag selected results in empy query set because there is no tag with slug 0...
The text was updated successfully, but these errors were encountered: