自定义邮政编码在自定义插件中不起作用

时间:2018-10-02 09:24:12

标签: wordpress

我在自定义插件中添加了自定义邮政编码,但未显示文本和其他内容。只是空白。

检查我的代码,让我知道出了什么问题。

function call_function_quiz() {
    $quiz_labels = array(
        'name'               => __( 'Custom Quiz', 'custom-quiz' ),
        'singular_name'      => __( 'Quiz', 'custom-quiz' ),
        'menu_name'          => __( 'Quiz', 'custom-quiz' ),
        'name_admin_bar'     => __( 'Quiz', 'custom-quiz' ),
        'add_new'            => __( 'Add New', 'custom-quiz' ),
        'add_new_item'       => __( 'Add New Quiz', 'custom-quiz' ),
        'new_item'           => __( 'New Quiz', 'custom-quiz' ),
        'edit_item'          => __( 'Edit Quiz', 'custom-quiz' ),
        'view_item'          => __( 'View Quiz', 'custom-quiz' ),
        'all_items'          => __( 'All Quizzes', 'custom-quiz' ),
        'search_items'       => __( 'Search Quizzes', 'custom-quiz' ),
        'parent_item_colon'  => __( 'Parent Quiz:', 'custom-quiz' ),
        'not_found'          => __( 'No Quiz Found', 'custom-quiz' ),
        'not_found_in_trash' => __( 'No Quiz Found In Trash', 'custom-quiz' ),
    );

    $quiz_args = array(
        'public'              => true,
        'show_ui'             => true,
        'show_in_menu'        => false,
        'show_in_nav_menus'   => true,
        'labels'              => true,
        'publicly_queryable'  => true,
        'exclude_from_search' => $exclude_search,
        'label'               => $plural_name,
        'rewrite'             => array( 'slug' => $cpt_slug ),
        'has_archive'         => $has_archive,
        'supports'            => array( 'title', 'author', 'comments' )
    );
    register_post_type( 'quiz', $quiz_args );
}
add_action( 'init', 'call_function_quiz' );
add_action( 'admin_menu', 'setup_admin_menu');
function setup_admin_menu() {
add_menu_page('Custom Quiz', 'Custom Quiz', 'manage_options', 'custom-quiz', 'call_function_quiz' );
}

0 个答案:

没有答案