A
A
Anita Kovaleva2020-06-11 12:19:53
WordPress
Anita Kovaleva, 2020-06-11 12:19:53

Is it possible to create one page in Wordpress Multisite and apply it to the rest?

Wordpress Multisite, a content page is created on the main site, added to the menu.
How to implement adding this page to other sites automatically. Or do you still have to manually go to each and add separately?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pashenka, 2020-06-11
@Anitamsk

There is no example, but the algorithm is as follows: you cling to the event (to visit the event you need add_action) of the wordpress type page_published (this is conditional, I'm on mobile, I'm too lazy to check, look for the exact name of the event) on the site where you first create the page with your hands, then you need to figure out how to determine which page to add, and cut off unnecessary cases or even all pages.
I don’t know if this event will contain information about page data such as title, content, etc. Now we have the data published initially. Then we look, firstly: how to create a page in VP (wp_insert_post is understandable with a post, maybe the pages are the same), and secondly: how to post exactly in a multisite. In multisite mode, each of its sites has its own id. That's all. In a cycle, we post our pages to all sites. Most likely, all multisite sites are also obtainable, so the cycle will be dynamic and will work even if new sites come in.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question