自定义本机标签元框

时间:2014-02-11 17:59:24

标签: php wordpress tags wordpress-theming

我添加了一个标签元框和分类法,以允许我的CPT上的标签。但是,我无法在编解码器中找到编辑“用逗号分隔标签”和“从最常用的标签中选择”的参数。有没有人知道这些的过滤器或register_taxonomy参数?

enter image description here

1 个答案:

答案 0 :(得分:0)

我找到了get_taxonomy_labels的参数列表,其中包含这些字段的正确参数。我能够将这些添加到我现有的register_taxonomy()函数的标签中。

register_taxonomy( 'domain_tag', 
    array('domain_profiles'), /* if you change the name of register_post_type( 'domain_profiles', then you have to change this */
    array('hierarchical' => false,    /* if this is false, it acts like tags */
        'labels' => array(
            'name' => __( 'Related Domains', 'bonestheme' ), /* name of the custom taxonomy */
            'singular_name' => __( 'Domain', 'bonestheme' ), /* single taxonomy name */
            'search_items' =>  __( 'Search Domains', 'bonestheme' ), /* search title for taxomony */
            'all_items' => __( 'All Related Domains', 'bonestheme' ), /* all title for taxonomies */
            'parent_item' => __( 'Parent Domain', 'bonestheme' ), /* parent title for taxonomy */
            'parent_item_colon' => __( 'Parent Domain:', 'bonestheme' ), /* parent taxonomy title */
            'edit_item' => __( 'Edit Domain', 'bonestheme' ), /* edit Domain taxonomy title */
            'update_item' => __( 'Update Domain', 'bonestheme' ), /* update title for taxonomy */
            'add_new_item' => __( 'Add New Domain', 'bonestheme' ), /* add new title for taxonomy */
            'new_item_name' => __( 'New Domain Name', 'bonestheme' ), /* name title for taxonomy */
            // See get_taxonomy_labels for more arguments (below)
            'separate_items_with_commas' => __( 'Separate domains with commas', 'bonestheme' ),
            'choose_from_most_used' => __( 'Choose from the most used', 'bonestheme' ),
        ),
        'show_admin_column' => true,
        'show_ui' => true,
        'query_var' => true,
    )
);