Thursday, September 8, 2022
HomeWordPress Developmentget_quiried_object on my customized submit kind shouldn't be displaying my submit taxonomy...

get_quiried_object on my customized submit kind shouldn’t be displaying my submit taxonomy names


I am on WordPress 6.0. Operating PHP 7.4. I’ve 3 registered taxonomies related to a customized submit kind. Under is an instance of how considered one of my registered taxonomies appears in code :


operate _mchid_degree() {

    $labels = array(
        'title'                       => _x( 'Diploma', 'Taxonomy Common Identify', '_mchid' ),
        'singular_name'              => _x( 'Diploma', 'Taxonomy Singular Identify', '_mchid' ),
        'menu_name'                  => __( 'Diploma', '_mchid' ),
        'all_items'                  => __( 'Levels', '_mchid' ),
        'parent_item'                => __( 'Diploma', '_mchid' ),
        'parent_item_colon'          => __( 'Diploma', '_mchid' ),
        'new_item_name'              => __( 'Diploma', '_mchid' ),
        'add_new_item'               => __( 'Add New Diploma', '_mchid' ),
        'edit_item'                  => __( 'Edit Diploma', '_mchid' ),
        'update_item'                => __( 'Replace Diploma', '_mchid' ),
        'view_item'                  => __( 'View Diploma', '_mchid' ),
        'separate_items_with_commas' => __( 'Separate objects with commas', '_mchid' ),
        'add_or_remove_items'        => __( 'Add or take away Training', '_mchid' ),
        'choose_from_most_used'      => __( 'Select from probably the most used', '_mchid' ),
        'popular_items'              => __( 'Widespread Objects', '_mchid' ),
        'search_items'               => __( 'Search Objects', '_mchid' ),
        'not_found'                  => __( 'Not Discovered', '_mchid' ),
    );

    $args = array(
        'labels'                     => $labels,
        'hierarchical'               => true,
        'public'                     => true,
        'has_archive'                => true,
        'show_ui'                    => true,
        'show_admin_column'          => true,
        'show_in_nav_menus'          => true,
    );
    register_taxonomy( 'diploma', array( 'colleges' ), $args );
}

From my wp-admin space within the UI, inside my customized submit kind space, I can create a submit and assign a level taxonomy time period to that particular submit. I can even see that time period rely is about to 1 due to that.

However! once I edit my customized submit template file (single-schools.php) in try to indicate all taxonomy names related to this submit…

  $show_it_all = get_queried_object();
  echo  '<pre>'  .  var_export($show_it_all, true) .  '</pre>';

…it reveals me every thing about my submit besides taxonomy info. Why is that?


WP_Post::__set_state(array(
   'ID' => 929,
   'post_author' => '3',
   'post_date' => '2022-08-26 01:59:23',
   'post_date_gmt' => '2022-08-26 01:59:23',
   'post_content' => '...my content material...',
   'post_title' => 'Accountant',
   'post_excerpt' => '',
   'post_status' => 'publish',
   'comment_status' => 'closed',
   'ping_status' => 'closed',
   'post_password' => '',
   'post_name' => 'accountant',
   'to_ping' => '',
   'pinged' => '',
   'post_modified' => '2022-09-01 19:48:32',
   'post_modified_gmt' => '2022-09-01 19:48:32',
   'post_content_filtered' => '',
   'post_parent' => 0,
   'guid' => 'http://localhost:64069/?post_type=colleges&p=929',
   'menu_order' => 0,
   'post_type' => 'colleges',
   'post_mime_type' => '',
   'comment_count' => '0',
   'filter' => 'uncooked',
))

My Purpose – I wish to dynamically get “all” taxonomy names which can be “related” to my present submit (i.e. ‘diploma’,’exercise’,’schedule’,’and so forth’).

Many thanks for any suggestions!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments