• Resolved unicornboat

    (@unicornboat)


    I add entries using below code:
    pods(‘shops’)->add(array(
    ‘name’ => ‘Shop 1’
    ));

    I get see data using pods(‘shops’)->fetch() but these data don’t appear in the admin ui like the ones I added using the ui.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @unicornboat

    My guess is that the pods require more information than just the name, what are all the required fields?

    Cheers, Jory

    Thread Starter unicornboat

    (@unicornboat)

    Hi @keraweb,
    It does require more fields which I just ignored to put here because they are all my custom fields such as ‘phone’, ‘address’, and etc.

    Those fields are manually created via Pods Admin UI.
    I can see the manually created pod item in the UI has
    pandarf_parent_pod_id
    pandarf_parent_post_id
    pandarf_pod_field_id
    with proper values such as 199, 282, 221.

    The ones created using pods()->add() all have “0” in those fields. They do appear in the UI when I manually add values in
    pandarf_parent_pod_id
    pandarf_parent_post_id
    pandarf_pod_field_id

    I wonder if I missed some steps before of after pods()->add()?

    The method I found is from here:
    https://pods.io/docs/code/pods/add/

    • This reply was modified 3 years, 8 months ago by unicornboat.
    • This reply was modified 3 years, 8 months ago by unicornboat.
    • This reply was modified 3 years, 8 months ago by unicornboat.
    • This reply was modified 3 years, 8 months ago by unicornboat.
    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @unicornboat

    Just to be sure, is this about an ACT or a custom post type?
    And did you supply all fields that are required?

    I don’t really recognize the fields you mention. I believe these are Pod fields, and not Pods item fields.

    Please let us know more about your configuration!

    Cheers, Jory

    Thread Starter unicornboat

    (@unicornboat)

    Hi @keraweb,

    You are right, shop_details is actually pods item of a pod called shop_page.

    I should use pods_field. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘pods:add doesn’t create entries in ui’ is closed to new replies.