Add roles and capabilities
This commit is contained in:
@@ -13,7 +13,8 @@ function sp_column_cpt_init() {
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'page-attributes' ),
|
||||
'register_meta_box_cb' => 'sp_column_meta_init',
|
||||
'show_in_menu' => 'edit.php?post_type=sp_event'
|
||||
'show_in_menu' => 'edit.php?post_type=sp_event',
|
||||
'capability_type' => 'sp_config'
|
||||
);
|
||||
register_post_type( 'sp_column', $args );
|
||||
}
|
||||
|
||||
@@ -11,10 +11,9 @@ function sp_event_cpt_init() {
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'author', 'comments' ),
|
||||
'register_meta_box_cb' => 'sp_event_meta_init',
|
||||
'rewrite' => array( 'slug' => 'event' ),
|
||||
'menu_position' => 42
|
||||
'rewrite' => array( 'slug' => get_option( 'sp_event_slug', 'event' ) ),
|
||||
'capability_type' => 'sp_event'
|
||||
);
|
||||
$args['labels']['menu_name'] = __( 'SportsPress', 'sportspress' );
|
||||
register_post_type( 'sp_event', $args );
|
||||
}
|
||||
add_action( 'init', 'sp_event_cpt_init' );
|
||||
|
||||
@@ -12,7 +12,8 @@ function sp_list_cpt_init() {
|
||||
'supports' => array( 'title', 'author' ),
|
||||
'register_meta_box_cb' => 'sp_list_meta_init',
|
||||
'rewrite' => array( 'slug' => 'list' ),
|
||||
'show_in_menu' => 'edit.php?post_type=sp_player'
|
||||
'show_in_menu' => 'edit.php?post_type=sp_player',
|
||||
'capability_type' => 'sp_list'
|
||||
);
|
||||
register_post_type( 'sp_list', $args );
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ function sp_outcome_cpt_init() {
|
||||
'show_in_nav_menus' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'page-attributes' ),
|
||||
'show_in_menu' => 'edit.php?post_type=sp_event'
|
||||
'show_in_menu' => 'edit.php?post_type=sp_event',
|
||||
'capability_type' => 'sp_config'
|
||||
);
|
||||
register_post_type( 'sp_outcome', $args );
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ function sp_player_cpt_init() {
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'author', 'thumbnail' ),
|
||||
'register_meta_box_cb' => 'sp_player_meta_init',
|
||||
'rewrite' => array( 'slug' => 'player' ),
|
||||
'menu_position' => 44
|
||||
'rewrite' => array( 'slug' => get_option( 'sp_player_slug', 'player' ) ),
|
||||
'capability_type' => 'sp_player'
|
||||
);
|
||||
register_post_type( 'sp_player', $args );
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ function sp_result_cpt_init() {
|
||||
'show_in_nav_menus' => false,
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'page-attributes' ),
|
||||
'show_in_menu' => 'edit.php?post_type=sp_event'
|
||||
'show_in_menu' => 'edit.php?post_type=sp_event',
|
||||
'capability_type' => 'sp_config'
|
||||
);
|
||||
register_post_type( 'sp_result', $args );
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ function sp_staff_cpt_init() {
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'author', 'thumbnail' ),
|
||||
'register_meta_box_cb' => 'sp_staff_meta_init',
|
||||
'rewrite' => array( 'slug' => 'staff' ),
|
||||
'menu_position' => 45
|
||||
'rewrite' => array( 'slug' => get_option( 'sp_staff_slug', 'staff' ) ),
|
||||
'capability_type' => array( 'sp_staff', 'sp_staff' )
|
||||
);
|
||||
register_post_type( 'sp_staff', $args );
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ function sp_statistic_cpt_init() {
|
||||
'hierarchical' => false,
|
||||
'supports' => array( 'title', 'page-attributes' ),
|
||||
'register_meta_box_cb' => 'sp_statistic_meta_init',
|
||||
'show_in_menu' => 'edit.php?post_type=sp_event'
|
||||
'show_in_menu' => 'edit.php?post_type=sp_event',
|
||||
'capability_type' => 'sp_config'
|
||||
);
|
||||
register_post_type( 'sp_statistic', $args );
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ function sp_table_cpt_init() {
|
||||
'supports' => array( 'title', 'author', 'excerpt' ),
|
||||
'register_meta_box_cb' => 'sp_table_meta_init',
|
||||
'rewrite' => array( 'slug' => 'table' ),
|
||||
'show_in_menu' => 'edit.php?post_type=sp_team'
|
||||
'show_in_menu' => 'edit.php?post_type=sp_team',
|
||||
'capability_type' => 'sp_table'
|
||||
);
|
||||
register_post_type( 'sp_table', $args );
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ function sp_team_cpt_init() {
|
||||
'hierarchical' => true,
|
||||
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes' ),
|
||||
'register_meta_box_cb' => 'sp_team_meta_init',
|
||||
'rewrite' => array( 'slug' => 'team' ),
|
||||
'menu_position' => 43
|
||||
'rewrite' => array( 'slug' => get_option( 'sp_team_slug', 'team' ) ),
|
||||
'capability_type' => 'sp_team'
|
||||
);
|
||||
register_post_type( 'sp_team', $args );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user