• Resolved teeboy4real

    (@teeboy4real)


    Hello,

    I use the code below to add custom (advert type) taxonomy but when users submit an ad new advert type taxonomies are automatically created in the form of numbers, see image below

    View post on imgur.com

    this is the code im using for the advert type taxonomy

    /* ------------------------------------------------------------------------- *
     * Add new ADVERT TYPE taxonomy to WP Adverts
    /* ------------------------------------------------------------------------- */
    add_action( "init", function() {
        // Register new taxonomy and assign it to WPAdverts
        $args = array(
            'label' => "Advert Type",
            'hierarchical' => false,
            'query_var' => true,
            'meta_box_cb' => false,
            'rewrite' => array('hierarchical' => true, 'slug' => 'advert-type' )
        );
        register_taxonomy( 'advert_type', 'advert', $args );
        register_taxonomy( 'tags', 'advert' );
    
    });
    add_action( "admin_init", function() {
        // hide custom taxonomies in the sidebar
        // Custom Fields editor will handle them
        remove_meta_box( 'tagsdiv-tags', 'advert', 'side' );
    } );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    1. are you using the latest WPAdverts version? If not then try updating and see if it helps.

    2. if you are using the latest version and it still does not work, in the above code try changing 'hierarchical' => false, to 'hierarchical' => true,

    Thread Starter teeboy4real

    (@teeboy4real)

    Hello Greg

    I am using the latest version of WPAdverts changing the value to ‘hierarchical’ => true, fixed the problem.

    This is issue is now resolved

    Thanks

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    ok great, i am marking this thread as resolved then.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom taxonomy problem’ is closed to new replies.