[wp-trac] [WordPress Trac] #62086: Add Filter for Custom Form Attributes in New Site Creation (/wp-admin/network/site-new.php)
WordPress Trac
noreply at wordpress.org
Thu Jun 26 19:56:02 UTC 2025
#62086: Add Filter for Custom Form Attributes in New Site Creation (/wp-
admin/network/site-new.php)
----------------------------------+----------------------------------------
Reporter: sakibmoon | Owner: realloc
Type: enhancement | Status: assigned
Priority: normal | Milestone: 6.9
Component: Networks and Sites | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch has-test- | Focuses: administration, multisite
info |
----------------------------------+----------------------------------------
Changes (by SirLouen):
* keywords: has-patch needs-testing => has-patch has-test-info
Comment:
== Test Report
=== Description
✅ This report validates that the indicated patch works as expected.
Patch tested: https://github.com/WordPress/wordpress-
develop/pull/9084.diff
=== Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.28
- Server: nginx/1.27.5
- Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
- Browser: Chrome 137.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-One 2.5
- MU Plugins: None activated
- Plugins:
* Network Site Logo 1.0.0
* Test Reports 1.2.0
=== Patch Testing Instructions
1. Create a Multisite
2. Add the code provided in supplemental artifacts for testing. Basically,
I'm adding as OP suggested, a field to add a logo. You can modify the code
and add whatever field you like for the test
3. Go to `/wp-admin/network/site-new.php`
4. Add the file or whatever content you have added in the form
5. Check in the DB, in the new options table for the newly created
multisite, example `wp_2_options` the `site_logo_url` field has been
introduced with the URL of the logo.
=== Actual Results
1. ✅ Issue resolved with patch.
=== Supplemental Artifacts
Testing Code:
{{{
function add_ms_logo_field() {
?>
<tr class="form-field">
<th scope="row"><label for="site-logo"><?php echo 'Site
Logo'; ?></label></th>
<td><input name="site_logo" type="file" id="site-logo"
/></td>
</tr>
<?php
}
add_action( 'network_site_new_form', 'add_ms_logo_field' );
function save_ms_logo( $new_site ) {
require_once ABSPATH . 'wp-admin/includes/file.php';
switch_to_blog( $new_site->blog_id );
$upload_overrides = array( 'test_form' => false );
$movefile = wp_handle_upload( $_FILES['site_logo'],
$upload_overrides );
update_option( 'site_logo_url', $movefile['url'] );
restore_current_blog();
}
add_action( 'wp_initialize_site', 'save_ms_logo', 10, 1 );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62086#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list