WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 3 days ago

Last modified 43 hours ago

#50704 closed enhancement (fixed)

network_site_info_form action missing in site-info.php

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

Description

Hi,
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 3 months ago.

Download all attachments as: .zip

Change History (9)

#1 @SergeyBiryukov
3 months 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?

@virgodesign
3 months ago

#2 @virgodesign
3 months ago

  • Keywords has-patch added; needs-patch removed

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

#3 @SergeyBiryukov
6 weeks ago

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

#4 @hellofromTonya
11 days ago

  • Keywords has-dev-note added

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

#5 @SergeyBiryukov
7 days ago

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

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


7 days ago

#7 @SergeyBiryukov
3 days 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.


43 hours ago

Note: See TracTickets for help on using tickets.