Create WP multisites as a custom post type

Question

I have a multisite network and have ACF site options on each subsite. The subsites are related eg some might be in the same area. I would like to add an ACF relationship field to each subsite where a list of all subsites can be displayed and sites can be picked from that.

To do this, the list of subsites needs to be a custom post type. I have looked but cant seem to find anyway to save list of all sites under a multisite network as posts under a custom post type. I am able to use get_sites() and switch_to_blog() to get basic info about the subsites but saving them as a cpt is the blocker. It would also be nice to have some of the site options saved as custom fields under that post type.

Anyone done something similar or any idea how to achieve this please?

0
Kay 2 months 2022-12-11T12:38:24-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse