add_action( 'init', 'create_events' );
function create_events() {
$labels = array(
'name' => _x('Training', 'post type general name'),
'singular_name' => _x('Event', 'post type singular name'),
'add_new' => _x('Add New', 'Event'),
'add_new_item' => __('Add New Event'),
'edit_item' => __('Edit Event'),
'new_item' => __('New Event'),
'view_item' => __('View Event'),
'search_items' => __('Search Events'),
'not_found' => __('No Events found'),
'not_found_in_trash' => __('No Events found in Trash'),
'parent_item_colon' => ''
);
$supports = array('title', 'editor', 'custom-fields', 'revisions', 'excerpt');
register_post_type( 'event',
array(
'labels' => $labels,
'public' => true,
'supports' => $supports
)
);
}
谁能帮我解释下$labels中参数的意义,$supports参数的意义,register_post_type参数的意义
我就是想在文章后面添加下时间、价格,这类单独的输入框(时间最好可以加载时间插件)
当更新的时候,可以自动将时间、价格及其他按照一定的格式加载到页面内容中
function create_events() {
$labels = array(
'name' => _x('Training', 'post type general name'),
'singular_name' => _x('Event', 'post type singular name'),
'add_new' => _x('Add New', 'Event'),
'add_new_item' => __('Add New Event'),
'edit_item' => __('Edit Event'),
'new_item' => __('New Event'),
'view_item' => __('View Event'),
'search_items' => __('Search Events'),
'not_found' => __('No Events found'),
'not_found_in_trash' => __('No Events found in Trash'),
'parent_item_colon' => ''
);
$supports = array('title', 'editor', 'custom-fields', 'revisions', 'excerpt');
register_post_type( 'event',
array(
'labels' => $labels,
'public' => true,
'supports' => $supports
)
);
}
谁能帮我解释下$labels中参数的意义,$supports参数的意义,register_post_type参数的意义
我就是想在文章后面添加下时间、价格,这类单独的输入框(时间最好可以加载时间插件)
当更新的时候,可以自动将时间、价格及其他按照一定的格式加载到页面内容中
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货