Opened 11 years ago
Last modified 3 months ago
#27289 new enhancement
Add populate_network action
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Networks and Sites | Keywords: | has-patch has-unit-tests |
Focuses: | multisite | Cc: |
Description
At the moment, populate_network_meta
is the only hook available to do extra work when a new network is created. However, this is called before the initial site is created when installing the first network. This means it's impossible to do certain things on network creation, such as creating new sites.
(I want to be able to create a new site on network creation so that the network always starts with two sites: the migrated main site and another site.)
Attachments (1)
Change History (10)
#1
@
11 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
#6
@
6 years ago
- Keywords bulk-reopened has-patch added; needs-patch removed
Hey I have created a patch with three new actions.
One before the beginning of the function,
One when creating a new multisite instance
One when creating a new network (already in a multisite mode)
#7
@
9 months ago
- Keywords needs-refresh added; reporter-feedback bulk-reopened removed
- Milestone set to Awaiting Review
Found this one scrubbing a report of tickets without a milestone.
Is this still something that would be useful? If so, the patch needs to be refreshed for testing and review.
#8
@
9 months ago
@desrosj Hello, yes I would say it's still useful as Multisite is still lacking attention / some hooks sometimes, so even if it's not popular or drag much attention, it looks like it could help agencies developing complex networks for example.
This ticket was mentioned in PR #8334 on WordPress/wordpress-develop by @sukhendu2002.
4 months ago
#9
- Keywords has-unit-tests added; needs-refresh removed
This PR adds three new action hooks to the network creation process and related unit tests, allowing developers to extend functionality at key points during network creation:
before_populate_network
- Fires before any network operations begin, allowing for setup or validationafter_upgrade_to_multisite
- Fires specifically when upgrading from single site to multisite (network_id = 1)after_populate_network
- Fires after network creation is complete, enabling post-creation tasks
Trac ticket: https://core.trac.wordpress.org/ticket/27289
Patch Refresh for: https://core.trac.wordpress.org/attachment/ticket/27289/27289.patch
This ticket was mentioned in PR #8532 on WordPress/wordpress-develop by @sukhendu2002.
3 months ago
#11
- Keywords has-patch has-unit-tests added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/27289
I've wanted this too.
There are two scenarios for
populate_network()
. In the most common, we're moving a single site install to multisite and applying initial configuration. In the other, it is called separately to create a new network. When a new network is created manually, the steps for assigning a main site are skipped and you're on your own to complete the setup tasks that need to run.Where does the action make sense in this? If it makes sense for both cases, we may need to pass some contextual information. If it only makes sense for initial install,
populate_network
may not be the right name for the action.