Making WordPress.org


Ignore:
Timestamp:
02/28/2019 08:22:40 PM (8 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Migrate wpmu_new_blog to wp_initialize_site.

The old action is deprecated, per ​https://core.trac.wordpress.org/ticket/41333.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/jetpack-tweaks/new-sites.php

    r7501 r8375  
    22
    33namespace WordCamp\Jetpack_Tweaks;
     4use WP_Site;
    45
    56defined( 'WPINC' ) or die();
    … …  
    78add_filter( 'jetpack_get_default_modules',                     __NAMESPACE__ . '\default_jetpack_modules'       );
    89add_filter( 'pre_update_site_option_jetpack-network-settings', __NAMESPACE__ . '\auto_connect_new_sites', 10, 2 );
    9 add_action( 'wpmu_new_blog',                                   __NAMESPACE__ . '\schedule_connect_new_site'    );
     10add_action( 'wp_initialize_site',                              __NAMESPACE__ . '\schedule_connect_new_site', 11 );
    1011add_action( 'wcorg_connect_new_site',                          __NAMESPACE__ . '\wcorg_connect_new_site', 10, 2 );
    1112
    … …  
    4041 * Schedule an email asking to connect Jetpack to WordPress.com
    4142 *
    42  * @param int $blog_id The blog id.
     43 * @param WP_Site $new_site
    4344 */
    44 function schedule_connect_new_site( $blog_id ) {
     45function schedule_connect_new_site( $new_site ) {
    4546        wp_schedule_single_event(
    4647                time() + 12 * HOUR_IN_SECONDS + 600, // After the the SSL certificate has been installed
    4748                'wcorg_connect_new_site_email',
    48                 array( $blog_id, get_current_user_id() )
     49                array( $new_site->blog_id, get_current_user_id() )
    4950        );
    5051}
Note: See TracChangeset for help on using the changeset viewer.