WordPress.org

Make WordPress Core

Ticket #34739: extend_site_new.patch

File extend_site_new.patch, 1.8 KB (added by igmoweb, 4 years ago)

Extend site-new.php patch

  • src/wp-admin/network/site-new.php

     
    110110                do_action( 'network_site_new_created_user', $user_id );
    111111        }
    112112
     113        /**
     114         * Filter metadata passed to wpmu_create_blog in Add New Site Admin Network Screen
     115         *
     116         * @since
     117         *
     118         * @param array $meta List of meta for the new blog.
     119         * @param string $newdomain Domain of the new blog.
     120         * @param string $path Path of the new blog.
     121         * @param string $title Title of the new blog.
     122         * @param int $user_id ID of the new blog administrator.
     123         * @param int $current_site->id ID of the current Network.
     124         */
     125        $meta = apply_filters( 'network_site_new_blog_meta', $meta, $newdomain, $path, $title, $user_id, $current_site->id );
     126
    113127        $wpdb->hide_errors();
    114128        $id = wpmu_create_blog( $newdomain, $path, $title, $user_id, $meta, $current_site->id );
    115129        $wpdb->show_errors();
    116130        if ( ! is_wp_error( $id ) ) {
     131
     132
    117133                if ( ! is_super_admin( $user_id ) && !get_user_option( 'primary_blog', $user_id ) ) {
    118134                        update_user_option( $user_id, 'primary_blog', $id, true );
    119135                }
     
    219235                <tr class="form-field">
    220236                        <td colspan="2"><?php _e( 'A new user will be created if the above email address is not in the database.' ) ?><br /><?php _e( 'The username and password will be mailed to this email address.' ) ?></td>
    221237                </tr>
     238
    222239        </table>
     240
     241        <?php
     242                /**
     243                 * Fires after the Add New Site Admin Network Screen Form is rendered
     244                 * and before submit button is displayed and form tag is closed.
     245                 *
     246                 * Add you own custom fields here when creating new blogs in a network
     247                 *
     248                 * @since
     249                 */
     250                do_action( 'network_after_site_new_form' );
     251        ?>
     252
    223253        <?php submit_button( __('Add Site'), 'primary', 'add-site' ); ?>
    224254        </form>
    225255</div>