#34739 closed enhancement (fixed)
New filters to extend Add New Site Network Screen (wp-admin/network/site-new.php)
Reported by: | igmoweb | Owned by: | jeremyfelt |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Networks and Sites | Keywords: | has-patch commit |
Focuses: | administration, multisite | Cc: |
Description
Some plugins may need to add new fields in this screen. I attach a patch with two new hooks:
network_after_site_new_form
: Allows to add new fields before submit button is displayed and form tag is closednetwork_site_new_blog_meta
: We can pass the value of those fields to the meta array before creating a blog
Attachments (3)
Change History (10)
#1
@
9 years ago
And here's a use case: https://gist.github.com/igmoweb/9db3bc38a632b717d01c
It creates a Theme dropdown in that screen. The Super Admin can select the theme before creating the blog.
#2
@
9 years ago
- Keywords needs-refresh added
- Milestone changed from Awaiting Review to Future Release
Thanks for the ticket and patch, @igmoweb, this is definitely worth thinking about. #15389 is related, though I like that this ticket is more focused on just the new site form. I thought there was another related ticket, but nothing is popping up for me at the moment.
I'm not sure about the filter for $meta
. Anything hooking in to network_after_site_new_form
could probably also hook into wpmu_new_blog
to look for additional POST data.
#3
@
9 years ago
Yeah, I thought about it better after I uploaded the first patch. I've removed it in the latest patch ( 34739.patch).
Also updated the use case: https://gist.github.com/igmoweb/9db3bc38a632b717d01c
Thanks.
#4
@
9 years ago
- Keywords has-patch commit added; needs-refresh removed
- Milestone changed from Future Release to 4.5
- Type changed from feature request to enhancement
34739.2.patch is a refresh of 34739.patch. It removes "after" from the filter name so we have the same terminology as for user_new_form.
Any objections @jeremyfelt?
#5
@
9 years ago
None from me - 34739.2.patch looks good.
#6
@
9 years ago
- Owner set to jeremyfelt
- Resolution set to fixed
- Status changed from new to closed
In 36555:
#7
@
9 years ago
A suggestion: This would display all the themes in multisite network even if they are not enabled by super admins. With the below change it can be useful in the front end as well on wp-signup.php page.
Here is a code change I would recommend:
<?php foreach ( $themes as $theme ): ?> <?php if($theme->is_allowed()):?> <option value="<?php echo esc_attr( $theme->get_stylesheet() ); ?>"><?php echo $theme->title; ?></option> <?php endif; ?> <?php endforeach; ?>
Also I am working on something related to breaking the create new site page into steps https://github.com/neelakansha85/nsd-site-setup-wizard not sure if this would be helpful feature for the core.
Extend site-new.php patch