Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#50704 closed enhancement (fixed)

network_site_info_form action missing in site-info.php

Reported by: virgodesign's profile virgodesign Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version: 5.4
Component: Networks and Sites Keywords: good-first-bug has-patch has-dev-note
Focuses: administration, multisite Cc:


in the network administration, wordpress 4.5 introduced a new action in site-new.php that let users perform custom actions within the "new site creation" form.

The action is the following

 * Fires at the end of the new site form in network admin.
 * @since 4.5.0
do_action( 'network_site_new_form' );

One possible action to perform is, for example, add custom meta field to the new registered site.

As of wp 5.1 the support for site metadata as taken a big step further with the new db table wp_blogmeta.

In the site-info.php network admin screen there is no chance to display any custom fields created using for example the network_site_new_form previously introduced, nor any type of site metadata created by a super admin.

The missin key in this flow is an action that let users display/add custom fields in the site-info.php network admin screen.

I would like to propose to add the following action hook in site-info.php just before the submit_button() function:

 * Fires at the end of the site info form in network admin.
 * @since 5.5.1
 * @param int $id The site ID.
do_action( 'network_site_info_form', $id );

Attachments (1)

50704.diff (531 bytes) - added by virgodesign 4 years ago.

Download all attachments as: .zip

Change History (10)

#1 @SergeyBiryukov
4 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to 5.6

Hi there, welcome to WordPress Trac! Thanks for the ticket.

The suggestion makes sense and seems like a useful addition. Would you be interested in creating a patch?

4 years ago

#2 @virgodesign
4 years ago

  • Keywords has-patch added; needs-patch removed

Hi @SergeyBiryukov,
Thanks, I've submitted a patch for this ticket.

#3 @SergeyBiryukov
4 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @hellofromTonya
4 years ago

  • Keywords has-dev-note added

Adds a new action. Needs mention in Misc Dev Note.

#5 @SergeyBiryukov
4 years ago

  • Keywords needs-dev-note added; has-dev-note removed

This ticket was mentioned in Slack in #core by sergey. View the logs.

4 years ago

#7 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 49199:

Networks and Sites: Introduce network_site_info_form action.

The action fires at the end of the site info form in network admin, and complements the existing network_site_new_form action.

Props virgodesign.
Fixes #50704.

This ticket was mentioned in Slack in #core by sncoker. View the logs.

4 years ago

#9 @daisyo
4 years ago

  • Keywords has-dev-note added; needs-dev-note removed
Note: See TracTickets for help on using tickets.