From 3c1ce66767da7efc0c5e0313c6bc2ad1eb04df99 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 17 Jan 2017 03:53:42 +0000 Subject: [PATCH] Users: Introduce `signup_site_meta` and `signup_user_meta` for filtering signup metadata in `wpmu_signup_blog()` and `wpmu_signup_user()`, respectively. Props Mista-Flo. Fixes #39223. Built from https://develop.svn.wordpress.org/trunk@39920 git-svn-id: http://core.svn.wordpress.org/trunk@39857 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-functions.php | 31 +++++++++++++++++++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index ad8330a0e8..b2b37d599b 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -671,6 +671,23 @@ function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = a $key = substr( md5( time() . wp_rand() . $domain ), 0, 16 ); + /** + * Filters the metadata for a site signup. + * + * The metadata will be serialized prior to storing it in the database. + * + * @since 4.8.0 + * + * @param array $meta Signup meta data. Default empty array. + * @param string $domain The requested domain. + * @param string $path The requested path. + * @param string $title The requested site title. + * @param string $user The user's requested login name. + * @param string $user_email The user's email address. + * @param string $key The user's activation key. + */ + $meta = apply_filters( 'signup_site_meta', $meta, $domain, $path, $title, $user, $user_email, $key ); + $wpdb->insert( $wpdb->signups, array( 'domain' => $domain, 'path' => $path, @@ -720,6 +737,20 @@ function wpmu_signup_user( $user, $user_email, $meta = array() ) { $user_email = sanitize_email( $user_email ); $key = substr( md5( time() . wp_rand() . $user_email ), 0, 16 ); + /** + * Filters the metadata for a user signup. + * + * The metadata will be serialized prior to storing it in the database. + * + * @since 4.8.0 + * + * @param array $meta Signup meta data. Default empty array. + * @param string $user The user's requested login name. + * @param string $user_email The user's email address. + * @param string $key The user's activation key. + */ + $meta = apply_filters( 'signup_user_meta', $meta, $user, $user_email, $key ); + $wpdb->insert( $wpdb->signups, array( 'domain' => '', 'path' => '', diff --git a/wp-includes/version.php b/wp-includes/version.php index b2b8095107..91f5578edc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-39919'; +$wp_version = '4.8-alpha-39920'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.