array_pop => array_shift
This commit is contained in:
@@ -42,7 +42,7 @@ class SP_Meta_Box_Staff_Details {
|
|||||||
|
|
||||||
$roles = get_the_terms( $post->ID, 'sp_role' );
|
$roles = get_the_terms( $post->ID, 'sp_role' );
|
||||||
if ( $roles ):
|
if ( $roles ):
|
||||||
$term = array_pop( $roles );
|
$term = array_shift( $roles );
|
||||||
$role = $term->term_id;
|
$role = $term->term_id;
|
||||||
else:
|
else:
|
||||||
$role = null;
|
$role = null;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class SP_Staff extends SP_Custom_Post {
|
|||||||
public function role() {
|
public function role() {
|
||||||
$roles = get_the_terms( $this->ID, 'sp_role' );
|
$roles = get_the_terms( $this->ID, 'sp_role' );
|
||||||
if ( $roles ):
|
if ( $roles ):
|
||||||
return array_pop( $roles );
|
return array_shift( $roles );
|
||||||
else:
|
else:
|
||||||
return false;
|
return false;
|
||||||
endif;
|
endif;
|
||||||
|
|||||||
Reference in New Issue
Block a user