The MU forums have moved to WordPress.org

Automatically create page in *another* blog (7 posts)

  1. nitetalker
    Member
    Posted 15 years ago #

    I've looked for a plugin ... I would like to automatically create a page in a particular existing blog each time a new blog is created.

    Any ideas?

  2. tdjcbe
    Member
    Posted 15 years ago #

    A search for default pages returns a number of threads on the topic. Please review them and see if that helps. There's a number of different solutions that will do this.

  3. nitetalker
    Member
    Posted 15 years ago #

    Yes I've seen and benefitted from reading those threads. Thanks for the reply, tdjcbe. I've read those threads and they've helped me set up the automatic creation of a default page on each new blog at the time of its creation.

    Let me rephrase my question because this requirements is different ...

    My objective is for there to be a page on blog A corresponding with each blog that gets created thereafter.

    For example, assume blog A exists. When blog B is created I want a page to automatically be created in blog A. When blog C is created, I want a page to automatically be created in blog A. And so on for blogs D, E, F ...

  4. VentureMaker
    Member
    Posted 15 years ago #

  5. nitetalker
    Member
    Posted 15 years ago #

    Ah, thanks much, VM! This plugin doesn't sound it will do what I want out of the box but I may be able to adapt it for my needs. I'll download it and check it out at my first opportunity.

  6. nitetalker
    Member
    Posted 15 years ago #

    In thinking more about this, I should be able to accomplish my goal using the functions switch_to_blog() and restore_current_blog() in wpmu-functions.php. I'll post another reply here after I try it.

  7. nitetalker
    Member
    Posted 15 years ago #

    Surrounding the $wpdb->insert operation for the new page with calls to switch_to_blog() and restore_current_blog() in wpmu_functions.php is indeed my solution.

    Eventually I'll want to convert this from hack to plugin. A more generalized solution for automatic post/page creation upon blog creation would be desirable.

About this Topic

  • Started 15 years ago by nitetalker
  • Latest reply from nitetalker