Skip to content

Commit

Permalink
Merge pull request #3990 from jamesgol/pods_exists_post
Browse files Browse the repository at this point in the history
Allow pod_exists() to work if passed a post_type name
  • Loading branch information
sc0ttkclark authored Mar 2, 2017
2 parents 83bde5f + 942fc08 commit e260cc5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions classes/PodsAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -5324,6 +5324,10 @@ public function pod_exists ( $params, $type = null ) {
'post_type' => '_pods_pod',
'posts_per_page' => 1
) );

if ( is_array( $pod ) ) {
$pod = $pod[0];
}
}

if ( !empty( $pod ) && ( empty( $type ) || $type == get_post_meta( $pod->ID, 'type', true ) ) )
Expand Down

0 comments on commit e260cc5

Please sign in to comment.