Enable comments in event articles setting

This commit is contained in:
Brian Miyaji
2014-10-23 13:28:45 +11:00
parent d9f6774290
commit 9196d82aa7
5 changed files with 43 additions and 32 deletions

View File

@@ -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' ),

View File

@@ -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',

View File

@@ -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',

View File

@@ -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',

View File

@@ -364,9 +364,7 @@ class SP_Post_types {
)
);
register_post_type( 'sp_event',
apply_filters( 'sportspress_register_post_type_event',
array(
$args = array(
'labels' => array(
'name' => __( 'Events', 'sportspress' ),
'singular_name' => __( 'Event', 'sportspress' ),
@@ -386,14 +384,18 @@ class SP_Post_types {
'exclude_from_search' => false,
'hierarchical' => false,
'rewrite' => array( 'slug' => get_option( 'sportspress_event_slug', 'event' ) ),
'supports' => array( 'title', 'author', 'thumbnail', 'excerpt', 'comments' ),
'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(