Enable comments in event articles setting
This commit is contained in:
@@ -50,7 +50,7 @@ class SP_Settings_Events extends SP_Settings_Page {
|
||||
),
|
||||
|
||||
array(
|
||||
'title' => __( 'Display', 'sportspress' ),
|
||||
'title' => __( 'Templates', 'sportspress' ),
|
||||
'desc' => __( 'Logos', 'sportspress' ),
|
||||
'id' => 'sportspress_event_show_logos',
|
||||
'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( 'title' => __( 'Event List', 'sportspress' ), 'type' => 'title', 'id' => 'event_list_options' ),
|
||||
|
||||
@@ -47,7 +47,7 @@ class SP_Settings_Players extends SP_Settings_Page {
|
||||
),
|
||||
|
||||
array(
|
||||
'title' => __( 'Display', 'sportspress' ),
|
||||
'title' => __( 'Templates', 'sportspress' ),
|
||||
'desc' => __( 'Photo', 'sportspress' ),
|
||||
'id' => 'sportspress_player_show_photo',
|
||||
'default' => 'yes',
|
||||
|
||||
@@ -49,7 +49,7 @@ class SP_Settings_Staff extends SP_Settings_Page {
|
||||
),
|
||||
|
||||
array(
|
||||
'title' => __( 'Display', 'sportspress' ),
|
||||
'title' => __( 'Templates', 'sportspress' ),
|
||||
'desc' => __( 'Photo', 'sportspress' ),
|
||||
'id' => 'sportspress_staff_show_photo',
|
||||
'default' => 'yes',
|
||||
|
||||
@@ -49,7 +49,7 @@ class SP_Settings_Teams extends SP_Settings_Page {
|
||||
),
|
||||
|
||||
array(
|
||||
'title' => __( 'Display', 'sportspress' ),
|
||||
'title' => __( 'Templates', 'sportspress' ),
|
||||
'desc' => __( 'Logo', 'sportspress' ),
|
||||
'id' => 'sportspress_team_show_logo',
|
||||
'default' => 'yes',
|
||||
|
||||
@@ -364,36 +364,38 @@ class SP_Post_types {
|
||||
)
|
||||
);
|
||||
|
||||
register_post_type( 'sp_event',
|
||||
apply_filters( 'sportspress_register_post_type_event',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __( 'Events', 'sportspress' ),
|
||||
'singular_name' => __( 'Event', 'sportspress' ),
|
||||
'add_new_item' => __( 'Add New Event', 'sportspress' ),
|
||||
'edit_item' => __( 'Edit Event', 'sportspress' ),
|
||||
'new_item' => __( 'New', 'sportspress' ),
|
||||
'view_item' => __( 'View Event', 'sportspress' ),
|
||||
'search_items' => __( 'Search', 'sportspress' ),
|
||||
'not_found' => __( 'No results found.', 'sportspress' ),
|
||||
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
||||
),
|
||||
'public' => true,
|
||||
'show_ui' => true,
|
||||
'capability_type' => 'sp_event',
|
||||
'map_meta_cap' => true,
|
||||
'publicly_queryable' => true,
|
||||
'exclude_from_search' => false,
|
||||
'hierarchical' => false,
|
||||
'rewrite' => array( 'slug' => get_option( 'sportspress_event_slug', 'event' ) ),
|
||||
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt', 'comments' ),
|
||||
'has_archive' => false,
|
||||
'show_in_nav_menus' => true,
|
||||
'menu_icon' => 'dashicons-calendar',
|
||||
)
|
||||
)
|
||||
$args = array(
|
||||
'labels' => array(
|
||||
'name' => __( 'Events', 'sportspress' ),
|
||||
'singular_name' => __( 'Event', 'sportspress' ),
|
||||
'add_new_item' => __( 'Add New Event', 'sportspress' ),
|
||||
'edit_item' => __( 'Edit Event', 'sportspress' ),
|
||||
'new_item' => __( 'New', 'sportspress' ),
|
||||
'view_item' => __( 'View Event', 'sportspress' ),
|
||||
'search_items' => __( 'Search', 'sportspress' ),
|
||||
'not_found' => __( 'No results found.', 'sportspress' ),
|
||||
'not_found_in_trash' => __( 'No results found.', 'sportspress' ),
|
||||
),
|
||||
'public' => true,
|
||||
'show_ui' => true,
|
||||
'capability_type' => 'sp_event',
|
||||
'map_meta_cap' => true,
|
||||
'publicly_queryable' => true,
|
||||
'exclude_from_search' => false,
|
||||
'hierarchical' => false,
|
||||
'rewrite' => array( 'slug' => get_option( 'sportspress_event_slug', 'event' ) ),
|
||||
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt' ),
|
||||
'has_archive' => false,
|
||||
'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',
|
||||
apply_filters( 'sportspress_register_post_type_calendar',
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user