Make WordPress Core

Opened 16 years ago

Closed 11 years ago

#15389 closed enhancement (fixed)

Make New Site & New User Network form pluggable.

Reported by: ptahdunbar Owned by: jeremyfelt
Priority: normal Milestone: 4.5
Component: Networks and Sites Version: 3.1
Severity: normal Keywords: has-patch
Cc: Focuses: multisite, administration

Description

Problem: Currently the only way to add additional fields to the new site & new user network form is by dynamically injecting them using javascript.

Solution: They should either have action hooks or use the settings API. I'll provide patches for both methods.

In addition, I've added semantic ids to the current form fields so they can be selectively hidden.

Attachments (2)

ticket.15389.network-forms-hooks.diff (2.7 KB ) - added by ptahdunbar 16 years ago.
This patch uses the hooks approach
15389.diff (774 bytes ) - added by jeremyfelt 11 years ago.

Download all attachments as: .zip

Change History (12)

#1 @ptahdunbar
16 years ago

  • Cc trac@… added

Axing the settings api approach as that'll involve moving all the form processing to a new network/post.php file for just these two forms.

#2 @ptahdunbar
16 years ago

Alternatively, we could just have this within the forms:

do_settings_fields( 'wpms_new_site', 'default' );

Then:

add_settings_field( 'twitter-id', 'Twitter username', 'wpms_twitter_callback', 'wpmu_new_site', 'default' );

Which works, but that's only using half of the settings API as it won't make use of register_setting() (you'd have to handle form processing on your own).

@ptahdunbar
16 years ago

This patch uses the hooks approach

#3 @ocean90
16 years ago

  • Type defect (bug)enhancement

#4 @nacin
16 years ago

  • Milestone Awaiting ReviewFuture Release

#5 @nacin
13 years ago

  • Component Network AdminNetworks and Sites
  • Focuses administration added

#6 @jeremyfelt
13 years ago

  • Keywords needs-patch dev-feedback added; has-patch removed
  • Milestone Future Release3.9

Having a hook on both these pages would be great. In the standard user-new.php, we fire user_new_form after the closing table tag. It may be worth having some consistency, though per [25631] via #18709, this is a different form. Firing that outside the table would allow for more flexible output by plugins.

We should consider hitting this in 3.9 if possible.

#7 @jeremyfelt
13 years ago

  • Milestone 3.9Future Release

Going to push this to another release so that we can make sure we do it the right way. Ideally, this would be refactored quite a bit to make any extension easier. As it is, any new action added to the form would need a matching action to handle it on save to avoid even more hacky implementations.

#8 @chriscct7
11 years ago

  • Keywords needs-refresh added; needs-patch removed

@jeremyfelt
11 years ago

#9 @jeremyfelt
11 years ago

  • Keywords has-patch added; dev-feedback needs-refresh removed
  • Milestone Future Release4.5

I think we can use the same approach for users as we did for sites in #34739. 15389.diff does this.

#10 @jeremyfelt
11 years ago

  • Owner set to jeremyfelt
  • Resolutionfixed
  • Status newclosed

In 36556:

Multisite: Add a hook to the end of the network's Add New User form.

The network_user_new_form action can be used to extend the new user form.

Props ptahdunbar.
Fixes #15389.

Note: See TracTickets for help on using tickets.