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.

Trac ticket: https://core.trac.wordpress.org/ticket/62086
  • Loading branch information
sakibmoon committed Sep 20, 2024
1 parent 35907da commit d5dfa9f
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', '' ); ?>>
<?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 d5dfa9f

Please sign in to comment.