WordPress.org

Make WordPress Core

Ticket #35427: 35427.2.patch

File 35427.2.patch, 1.8 KB (added by jjeaton, 3 years ago)
  • src/wp-admin/user-new.php

     
    144144                                add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email
    145145                                add_filter( 'wpmu_welcome_user_notification', '__return_false' ); // Disable welcome email
    146146                        }
    147                         wpmu_signup_user( $new_user_login, $new_user_email, array( 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST['role'] ) );
     147
     148                        /** This filter is documented in wp-signup.php */
     149                        wpmu_signup_user( $new_user_login, $new_user_email, apply_filters( 'add_signup_meta', array( 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST['role'] ) ) );
    148150                        if ( isset( $_POST[ 'noconfirmation' ] ) && current_user_can( 'manage_network_users' ) ) {
    149151                                $key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $new_user_email ) );
    150152                                $new_user = wpmu_activate_signup( $key );
  • src/wp-includes/ms-functions.php

     
    720720        $user = preg_replace( '/\s+/', '', sanitize_user( $user, true ) );
    721721        $user_email = sanitize_email( $user_email );
    722722        $key = substr( md5( time() . rand() . $user_email ), 0, 16 );
    723         $meta = serialize($meta);
    724723
     724        /**
     725         * Filter meta variables used for user signup for future activation.
     726         *
     727         * @since 4.7.0
     728         *
     729         * @param array $meta {
     730         *     An array of default site meta variables.
     731         * }
     732         */
     733        $meta = serialize( apply_filters( 'wpmu_signup_user_meta', $meta, $user, $user_email ) );
     734
    725735        $wpdb->insert( $wpdb->signups, array(
    726736                'domain' => '',
    727737                'path' => '',