-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcpt-settings.php
48 lines (44 loc) · 2 KB
/
cpt-settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* @Author: Elias Kautto
* @Date: 2022-01-26 11:19:51
* @Last Modified by: Roni Laukkarinen
* @Last Modified time: 2023-12-01 12:03:30
*
* @package air-setting-groups
*/
namespace Air_Setting_Groups;
function register_cpt() {
$generated_labels = [
'menu_name' => __( 'Other content', 'air_setting_groups' ),
'name' => _x( 'Setting groups', 'post type general name', 'air_setting_groups' ),
'singular_name' => _x( 'Setting group', 'post type singular name', 'air_setting_groups' ),
'name_admin_bar' => _x( 'Setting groups', 'add new on admin bar', 'air_setting_groups' ),
'add_new' => _x( 'Add new', 'thing', 'air_setting_groups' ),
'add_new_item' => __( 'Add new setting group', 'air_setting_groups' ),
'new_item' => __( 'New setting group', 'air_setting_groups' ),
'edit_item' => __( 'Edit a setting group', 'air_setting_groups' ),
'view_item' => __( 'Show setting group', 'air_setting_groups' ),
'all_items' => __( 'Show all setting groups', 'air_setting_groups' ),
'search_items' => __( 'Search for setting groups', 'air_setting_groups' ),
'parent_item_colon' => __( 'Setting group parents', 'air_setting_groups' ),
'not_found' => __( 'Setting groups not found', 'air_setting_groups' ),
'not_found_in_trash' => __( 'Setting groups not found in the trash', 'air_setting_groups' ),
];
$args = [
'labels' => $generated_labels,
'description' => '',
'menu_position' => 55,
'menu_icon' => 'dashicons-forms',
'public' => false,
'has_archive' => false,
'exclude_from_search' => false,
'show_ui' => true,
'show_in_menu' => true,
'show_in_rest' => true,
'rewrite' => false,
'supports' => [ 'title', 'revisions', 'editor' ],
'taxonomies' => [],
];
register_post_type( get_prefix( true ), $args );
}