campusboy

anwppro query

Jul 10th, 2019
91
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $players = get_posts( [
  4.     'post_type'   => 'anwp_player',
  5.     'numberposts' => - 1,
  6. ] );
  7.  
  8. $players = array_filter( $players, function ( WP_Post $player ) {
  9.     $club_id = $player->_anwpfl_current_club;
  10.  
  11.     return ! ( $club_id && get_post_status( $club_id ) === 'publish' );
  12. } );
RAW Paste Data