• Resolved aquila76

    (@aquila76)


    Hello,

    I would like to develop a PHP script that can add new fields to an existing group of pods of a certain type (which, if necessary, will first be added to another type of pod).

    The two pod types will then be related, and when I manually change the first one, the second one will also be quickly updated by running the script. Do you think this is possible? How?

    I thought about using pods_api() first, but I don’t see any ready-made documentation at the moment, so I tried using add_post_metadata() and with that I can only add new meta fields but not update the fields of the pod group. Finally, I also thought about using pod_register_group() but I can’t use it or maybe it doesn’t work to update existing groups…

    Thank you for any help on what procedure could be followed and sorry for the inconvenience, I know that it may not be an interesting or actually useful problem…

    Best regards!

    • This topic was modified 6 months, 1 week ago by aquila76.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @aquila76

    Please check our file based configurations: https://docs.pods.io/code/registering-configurations/

    Cheers, Jory

    Thread Starter aquila76

    (@aquila76)

    Hi Jory, thank you! I was trying using the same reference you just gave me and I’ve already set my snippet:

    1. I’ve copied and adapted json export output of the first pod the for register type of second pod via PHP
    2. with the load_fields API i’ve extracted, set and registered group fields for the second pod
    3. then i’ve added the full register function as action on init hook and all works as I needed!

    Finally I will clone that new related pod to get all right ids to use them better and safetly (deactivating the snippet) i hope..

    eventually see you for the next question.. meantime have always a good work for your fantastic framework!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Manage pods fields groups programmatically’ is closed to new replies.