diff --git a/includes/admin/settings/class-sp-settings-events.php b/includes/admin/settings/class-sp-settings-events.php index 8fd71e03..fa89e58f 100644 --- a/includes/admin/settings/class-sp-settings-events.php +++ b/includes/admin/settings/class-sp-settings-events.php @@ -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' ), diff --git a/includes/admin/settings/class-sp-settings-players.php b/includes/admin/settings/class-sp-settings-players.php index 5aa1a225..61a877bb 100644 --- a/includes/admin/settings/class-sp-settings-players.php +++ b/includes/admin/settings/class-sp-settings-players.php @@ -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', diff --git a/includes/admin/settings/class-sp-settings-staff.php b/includes/admin/settings/class-sp-settings-staff.php index 8dfc45d3..48d62c33 100644 --- a/includes/admin/settings/class-sp-settings-staff.php +++ b/includes/admin/settings/class-sp-settings-staff.php @@ -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', diff --git a/includes/admin/settings/class-sp-settings-teams.php b/includes/admin/settings/class-sp-settings-teams.php index fb9ef40b..90672411 100644 --- a/includes/admin/settings/class-sp-settings-teams.php +++ b/includes/admin/settings/class-sp-settings-teams.php @@ -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', diff --git a/includes/class-sp-post-types.php b/includes/class-sp-post-types.php index 04835735..32d29668 100644 --- a/includes/class-sp-post-types.php +++ b/includes/class-sp-post-types.php @@ -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(