Skip to content

Commit

Permalink
Multisite: Add filter to allow custom form attributes in new site cre…
Browse files Browse the repository at this point in the history
…ation.

This change introduces the `network_site_new_form_attributes` filter 
to the site creation form (`/wp-admin/network/site-new.php`) in WordPress Multisite.

The filter allows developers to modify form attributes such as `enctype="multipart/form-data"`, enabling file uploads or other custom behaviors when creating a new site.

This enhancement provides more flexibility for developers extending the multisite functionality without requiring modifications to core files.

Fixes #62086
  • Loading branch information
sakibmoon committed Sep 20, 2024
1 parent 35907da commit 6b4e7a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-admin/network/site-new.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
}
?>
<p><?php echo wp_required_field_message(); ?></p>
<form method="post" action="<?php echo esc_url( network_admin_url( 'site-new.php?action=add-site' ) ); ?>" novalidate="novalidate">
<form method="post" action="<?php echo esc_url( network_admin_url( 'site-new.php?action=add-site' ) ); ?>" novalidate="novalidate"<?php echo apply_filters('network_new_site_form_attributes', ''); ?>>

Check failure on line 207 in src/wp-admin/network/site-new.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Expected 1 spaces after opening parenthesis; 0 found

Check failure on line 207 in src/wp-admin/network/site-new.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Expected 1 spaces before closing parenthesis; 0 found
<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?>
<table class="form-table" role="presentation">
<tr class="form-field form-required">
Expand Down

0 comments on commit 6b4e7a4

Please sign in to comment.