GithubHelp home page GithubHelp logo

Comments (4)

johnbillion avatar johnbillion commented on June 23, 2024

Can you post your complete post type and taxonomy registration code?

from extended-cpts.

limogin avatar limogin commented on June 23, 2024
    $labels = array(
      'name' => __('Artwork'),
      'singular_name' => __('Artwork'),
      'add_new' => __('Add New'),
      'add_new_item' => __('Add New Artwork'),
      'edit' => __( 'Edit' ),
      'edit_item' => __('Edit Artwork'),
      'new_item' => __('New Artwork'),
      'all_items' => __('All Artworks'),
      'view_item' => __('View Artwork'),
      'search_items' => __('Search Artwork'),
      'not_found' => __('No Artworks found'),
      'not_found_in_trash' => __('No Artworks found in the Trash'),
      'parent_item_colon' => '',
      'menu_name' => __('Artworks')
    );

    $args = array(
      'labels' => $labels,
      'description' => __( 'Artworks collection' ),
      'hierarchical' => false,
      'supports' => array('title', 'thumbnail', 'editor', 'page-attributes'),
      'rewrite' => array('slug' => __('artwork'), 'with_front' => true),
      'public' => true,
      'publicly_queryable' => true,
      'exclude_from_search' => false,
      'show_ui' => true,
      'show_in_menu' => true,
      'show_in_nav_menus' => false,
      'show_in_feed' => true,
      //'menu_position' => 20,
      'query_var' => true,
      'has_archive' => false,
      'can_export' => true,
      'capability_type' => 'page',
      'menu_icon' => 'dashicons-format-image',
      'admin_cols' => array (
        'featured_image' => [
				  'title'          => __('Image'),
				  'featured_image' => 'thumbnail'
			  ],
        'date' => [
				   'title_icon'  => 'dashicons-calendar-alt',
				   'date_format' => 'd/m/Y'
			   ],
        'artwork_category' => [
           'title' => __('Category'),
           'taxonomy' => 'artwork_category',
         ],
        'menu_order' => [
 				   'title' => __('Position'),
           'post_field'=>'menu_order',
 			   ],
       ),
       'admin_filters' => array(
         'artwork_category' => [
           'title' => __('Category'),
           'taxonomy' => 'artwork_category',
         ],
	 	   ),
    );

    register_extended_post_type ('artwork', $args);

from extended-cpts.

limogin avatar limogin commented on June 23, 2024

I think that the issue is related why the get_taxonomy (https://developer.wordpress.org/reference/functions/get_taxonomy/) method don't return any value in the "query_var" attribute.

Then the "wp_dropdown_categories ( .." call (https://developer.wordpress.org/reference/functions/wp_dropdown_categories/) in PostTypeAdmin class, line 307 don't have any value in the name attribute.

from extended-cpts.

limogin avatar limogin commented on June 23, 2024

Ok, identified the issue. The param "query_var" when is declared in register_extended_taxonomy must be set to true.

from extended-cpts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.