Enable comments in event articles setting
This commit is contained in:
@@ -50,7 +50,7 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Display', 'sportspress' ),
|
'title' => __( 'Templates', 'sportspress' ),
|
||||||
'desc' => __( 'Logos', 'sportspress' ),
|
'desc' => __( 'Logos', 'sportspress' ),
|
||||||
'id' => 'sportspress_event_show_logos',
|
'id' => 'sportspress_event_show_logos',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
@@ -162,6 +162,15 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Comments', 'sportspress' ),
|
||||||
|
'desc' => __( 'Allow people to post comments on new articles', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_comment_status',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'desc_tip' => __( 'These settings may be overridden for individual articles.', 'sportspress' ),
|
||||||
|
),
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'event_options' ),
|
array( 'type' => 'sectionend', 'id' => 'event_options' ),
|
||||||
|
|
||||||
array( 'title' => __( 'Event List', 'sportspress' ), 'type' => 'title', 'id' => 'event_list_options' ),
|
array( 'title' => __( 'Event List', 'sportspress' ), 'type' => 'title', 'id' => 'event_list_options' ),
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class SP_Settings_Players extends SP_Settings_Page {
|
|||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Display', 'sportspress' ),
|
'title' => __( 'Templates', 'sportspress' ),
|
||||||
'desc' => __( 'Photo', 'sportspress' ),
|
'desc' => __( 'Photo', 'sportspress' ),
|
||||||
'id' => 'sportspress_player_show_photo',
|
'id' => 'sportspress_player_show_photo',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class SP_Settings_Staff extends SP_Settings_Page {
|
|||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Display', 'sportspress' ),
|
'title' => __( 'Templates', 'sportspress' ),
|
||||||
'desc' => __( 'Photo', 'sportspress' ),
|
'desc' => __( 'Photo', 'sportspress' ),
|
||||||
'id' => 'sportspress_staff_show_photo',
|
'id' => 'sportspress_staff_show_photo',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class SP_Settings_Teams extends SP_Settings_Page {
|
|||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Display', 'sportspress' ),
|
'title' => __( 'Templates', 'sportspress' ),
|
||||||
'desc' => __( 'Logo', 'sportspress' ),
|
'desc' => __( 'Logo', 'sportspress' ),
|
||||||
'id' => 'sportspress_team_show_logo',
|
'id' => 'sportspress_team_show_logo',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
|
|||||||
@@ -364,36 +364,38 @@ class SP_Post_types {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
register_post_type( 'sp_event',
|
$args = array(
|
||||||
apply_filters( 'sportspress_register_post_type_event',
|
'labels' => array(
|
||||||
array(
|
'name' => __( 'Events', 'sportspress' ),
|
||||||
'labels' => array(
|
'singular_name' => __( 'Event', 'sportspress' ),
|
||||||
'name' => __( 'Events', 'sportspress' ),
|
'add_new_item' => __( 'Add New Event', 'sportspress' ),
|
||||||
'singular_name' => __( 'Event', 'sportspress' ),
|
'edit_item' => __( 'Edit Event', 'sportspress' ),
|
||||||
'add_new_item' => __( 'Add New Event', 'sportspress' ),
|
'new_item' => __( 'New', 'sportspress' ),
|
||||||
'edit_item' => __( 'Edit Event', 'sportspress' ),
|
'view_item' => __( 'View Event', 'sportspress' ),
|
||||||
'new_item' => __( 'New', 'sportspress' ),
|
'search_items' => __( 'Search', 'sportspress' ),
|
||||||
'view_item' => __( 'View Event', 'sportspress' ),
|
'not_found' => __( 'No results found.', 'sportspress' ),
|
||||||
'search_items' => __( 'Search', 'sportspress' ),
|
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
||||||
'not_found' => __( 'No results found.', 'sportspress' ),
|
),
|
||||||
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
'public' => true,
|
||||||
),
|
'show_ui' => true,
|
||||||
'public' => true,
|
'capability_type' => 'sp_event',
|
||||||
'show_ui' => true,
|
'map_meta_cap' => true,
|
||||||
'capability_type' => 'sp_event',
|
'publicly_queryable' => true,
|
||||||
'map_meta_cap' => true,
|
'exclude_from_search' => false,
|
||||||
'publicly_queryable' => true,
|
'hierarchical' => false,
|
||||||
'exclude_from_search' => false,
|
'rewrite' => array( 'slug' => get_option( 'sportspress_event_slug', 'event' ) ),
|
||||||
'hierarchical' => false,
|
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt' ),
|
||||||
'rewrite' => array( 'slug' => get_option( 'sportspress_event_slug', 'event' ) ),
|
'has_archive' => false,
|
||||||
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt', 'comments' ),
|
'show_in_nav_menus' => true,
|
||||||
'has_archive' => false,
|
'menu_icon' => 'dashicons-calendar',
|
||||||
'show_in_nav_menus' => true,
|
|
||||||
'menu_icon' => 'dashicons-calendar',
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ( get_option( 'sportspress_event_comment_status', 'no' ) == 'yes' ):
|
||||||
|
$args[ 'supports' ][] = 'comments';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
register_post_type( 'sp_event', apply_filters( 'sportspress_register_post_type_event', $args ) );
|
||||||
|
|
||||||
register_post_type( 'sp_calendar',
|
register_post_type( 'sp_calendar',
|
||||||
apply_filters( 'sportspress_register_post_type_calendar',
|
apply_filters( 'sportspress_register_post_type_calendar',
|
||||||
array(
|
array(
|
||||||
|
|||||||
Reference in New Issue
Block a user