Skip to content

Commit

Permalink
When replacing strings (slugs) with ints (IDs), do not leave the orig…
Browse files Browse the repository at this point in the history
…inal strings in the array (#49)
  • Loading branch information
barryhughes committed Oct 21, 2015
1 parent 500b1b2 commit 7012a59
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions embedding/lister-objects.php
Expand Up @@ -338,18 +338,14 @@ protected function move_ignore_vals( array &$list, array &$ignore_list ) {
* @param string $type
*/
protected function parse_post_refs( &$list, $type = Tribe__Events__Main::POSTTYPE ) {
$new_list = array();

foreach ( $list as $index => $reference ) {
$this->typify( $reference );
if ( ! is_string( $reference ) ) continue;

$event = $this->load_post_by_slug( $reference, $type );

if ( $event ) $new_list[$index] = $event->ID;
if ( $event ) $list[$index] = $event->ID;
}

$list = array_merge( $list, $new_list );
}

/**
Expand Down

0 comments on commit 7012a59

Please sign in to comment.