Add comment support to Teams/Clubs pages
This commit is contained in:
@@ -81,6 +81,14 @@ class SP_Settings_Teams extends SP_Settings_Page {
|
|||||||
'default' => 'no',
|
'default' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Comments', 'sportspress' ),
|
||||||
|
'desc' => __( 'Allow people to post comments on Team page', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_team_comment_status',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
),
|
||||||
)),
|
)),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
|
|||||||
@@ -447,9 +447,7 @@ class SP_Post_types {
|
|||||||
|
|
||||||
register_post_type( 'sp_event', apply_filters( 'sportspress_register_post_type_event', $args ) );
|
register_post_type( 'sp_event', apply_filters( 'sportspress_register_post_type_event', $args ) );
|
||||||
|
|
||||||
register_post_type( 'sp_team',
|
$args = array(
|
||||||
apply_filters( 'sportspress_register_post_type_team',
|
|
||||||
array(
|
|
||||||
'labels' => array(
|
'labels' => array(
|
||||||
'name' => __( 'Teams', 'sportspress' ),
|
'name' => __( 'Teams', 'sportspress' ),
|
||||||
'singular_name' => __( 'Team', 'sportspress' ),
|
'singular_name' => __( 'Team', 'sportspress' ),
|
||||||
@@ -480,9 +478,13 @@ class SP_Post_types {
|
|||||||
'show_in_rest' => true,
|
'show_in_rest' => true,
|
||||||
'rest_controller_class' => 'SP_REST_Posts_Controller',
|
'rest_controller_class' => 'SP_REST_Posts_Controller',
|
||||||
'rest_base' => 'teams',
|
'rest_base' => 'teams',
|
||||||
)
|
);
|
||||||
)
|
|
||||||
);
|
if ( get_option( 'sportspress_team_comment_status', 'no' ) == 'yes' ):
|
||||||
|
$args[ 'supports' ][] = 'comments';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
register_post_type( 'sp_team', apply_filters( 'sportspress_register_post_type_team', $args ) );
|
||||||
|
|
||||||
register_post_type( 'sp_player',
|
register_post_type( 'sp_player',
|
||||||
apply_filters( 'sportspress_register_post_type_player',
|
apply_filters( 'sportspress_register_post_type_player',
|
||||||
|
|||||||
Reference in New Issue
Block a user