Support » Plugin: Pods - Custom Content Types and Fields » fetch() not returning CPT ID value

  • Resolved jjci

    (@jjci)


    Below is an excerpt from some PHP code which retrieves entries from a CPT ‘vox_loc_items’. It works, except that the CPT ID values are not being retrieved.

    $pods_Location_Items_params_where = “parent_location.ID = ” . $current_Location_ID;
    $pods_Location_Items_params = array(‘where’ => $pods_Location_Items_params_where);
    $Items = pods(‘vox_loc_items’,$pods_Location_Items_params);
    .
    while($Items -> fetch()) {
    $Item_ID = $Items[‘ID’];
    $Item_title = $Items->field(‘public_title’);
    }

    The good news is that the CPT ‘public_title’ field is being retrieved properly.
    However, the ID of the fetched entries cannot be found.

    Is the post ID normally returned by fetch()?
    If not, what is the best way to retrieve the post ID of each fetched entry?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘fetch() not returning CPT ID value’ is closed to new replies.