• Hi. Everything works great, but I do have a question/problem:

    How do I access the extra fields I have added in pods using php? The way I normally do with other pods is not getting any value when I access it this way:

    $mypod = pods( ‘pmpro_membership_user’ ), $params);

    $my_var = $mypod->display( ‘my_additional_pod_field’ ); // nothing

    I am using the pod name I see in the admin list of my pods– pmpro_membership_user

    However, I was able to grab an array of values using $debug_array = $mypod->data();
    Using var_dump on it, it has all the fields/values from the original DB table that pmpro uses, and that I assume this plugin is extending. So I am able to get the email value or display name from the original table.
    $original_var = $mypod->display( ‘user_email’ ); // returns that user’s email form pmpro
    So it seems possible to use pods to access the original table but not the extended fields.

    Not a deal breaker, but would be really nice to be able to use the extra fields/values in my code :). If not possible, my fallback is to just make a new pod and have a separate data entry form for the additional member related info.

    Also, I am currently actually passing in a $params that has a where that references my own custom field memberuserid.meta_value = ‘2’. So I know it is able to select in pods on my added field memberuserid. But again, I can’t even grab that field with a display, no matter how I try to reference it. Any advice on the where is appreciated too.

    Thanks in advance for any ideas.

  • The topic ‘How to programmatically access the new fields in php?’ is closed to new replies.