Skip to content

Commit

Permalink
Added additional post status filter.
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasPrt committed Jul 24, 2021
1 parent b0082fb commit 67506cc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions includes/custom-blocks/block-employees.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@
$employees = array();

foreach ( $fields['employees'] as $employee => $employee_id ) {
$employees[$employee_id] = get_post_meta( $employee_id );
$employees[$employee_id]['id'] = $employee_id;
$employees[$employee_id]['name'] = get_the_title( $employee_id );
$status = get_post_status( $employee_id );
if ($status == 'publish') {
$employees[$employee_id] = get_post_meta( $employee_id );
$employees[$employee_id]['id'] = $employee_id;
$employees[$employee_id]['name'] = get_the_title( $employee_id );
}
}

// sort by group and then by name
Expand Down

0 comments on commit 67506cc

Please sign in to comment.