Wrap event staff with template tag

This commit is contained in:
Brian Miyaji
2015-03-03 17:20:54 +11:00
parent 7cf5946880
commit 0ce341f33a

View File

@@ -21,36 +21,38 @@ if ( ! $staffs ) return;
extract( $defaults, EXTR_SKIP ); extract( $defaults, EXTR_SKIP );
?> ?>
<p class="sp-event-staff"> <div class="sp-template sp-template-event-staff">
<?php <p class="sp-event-staff">
foreach( $staffs as $staff_id ): <?php
foreach( $staffs as $staff_id ):
if ( ! $staff_id ) if ( ! $staff_id )
continue; continue;
$name = get_the_title( $staff_id ); $name = get_the_title( $staff_id );
if ( ! $name ) if ( ! $name )
continue; continue;
$staff = new SP_Staff( $staff_id ); $staff = new SP_Staff( $staff_id );
$role = $staff->role(); $role = $staff->role();
if ( $role ) if ( $role )
echo $role->name; echo $role->name;
else else
_e( 'Staff', 'sportspress' ); _e( 'Staff', 'sportspress' );
echo ': '; echo ': ';
if ( $link_posts ): if ( $link_posts ):
$permalink = get_post_permalink( $staff_id ); $permalink = get_post_permalink( $staff_id );
$name = '<a href="' . $permalink . '">' . $name . '</a>'; $name = '<a href="' . $permalink . '">' . $name . '</a>';
endif; endif;
echo $name . '<br>'; echo $name . '<br>';
endforeach; endforeach;
?> ?>
</p> </p>
</div>