Added option to link staff members to profile page #166
This commit is contained in:
@@ -50,6 +50,14 @@ class SP_Settings_Teams extends SP_Settings_Page {
|
|||||||
|
|
||||||
array( 'type' => 'team_tabs' ),
|
array( 'type' => 'team_tabs' ),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Staff', 'sportspress' ),
|
||||||
|
'desc' => __( 'Link staff', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_team_link_staff',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Link', 'sportspress' ),
|
'title' => __( 'Link', 'sportspress' ),
|
||||||
'desc' => __( 'Link teams', 'sportspress' ),
|
'desc' => __( 'Link teams', 'sportspress' ),
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ if ( ! isset( $id ) )
|
|||||||
|
|
||||||
$team = new SP_Team( $id );
|
$team = new SP_Team( $id );
|
||||||
$members = $team->staff();
|
$members = $team->staff();
|
||||||
|
$link_staff = get_option( 'sportspress_team_link_staff', 'no' ) === 'yes' ? true : false;
|
||||||
|
|
||||||
foreach ( $members as $staff ):
|
foreach ( $members as $staff ):
|
||||||
$id = $staff->ID;
|
$id = $staff->ID;
|
||||||
@@ -27,7 +28,7 @@ foreach ( $members as $staff ):
|
|||||||
$name = '<span class="sp-staff-role">' . implode( '<span class="sp-staff-role-delimiter">/</span>', $roles ) . '</span> ' . $name;
|
$name = '<span class="sp-staff-role">' . implode( '<span class="sp-staff-role-delimiter">/</span>', $roles ) . '</span> ' . $name;
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<h4 class="sp-staff-name"><?php echo $name; ?></h4>
|
<h4 class="sp-staff-name"><?php echo $link_staff ? '<a href="'. get_permalink( $id ) .'">'. $name .'</a>' : $name ?></h4>
|
||||||
<?php
|
<?php
|
||||||
sp_get_template( 'staff-photo.php', array( 'id' => $id ) );
|
sp_get_template( 'staff-photo.php', array( 'id' => $id ) );
|
||||||
sp_get_template( 'staff-details.php', array( 'id' => $id ) );
|
sp_get_template( 'staff-details.php', array( 'id' => $id ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user