WordPress.org

Making WordPress.org

Changeset 4275


Ignore:
Timestamp:
10/20/2016 12:34:46 AM (5 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Ensure maybe_create_new_site() only runs once

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php

    r4274 r4275  
    116116     */
    117117    public function maybe_create_new_site( $wordcamp_id ) {
     118        /*
     119         * If this were to be called again before it had finished -- e.g., when `WCORMailer::replace_placeholders()`
     120         * calls `WordCamp_Admin::metabox_save()` -- then it would `wpmu_create_blog()` would return a `blog_taken`
     121         * `WP_Error` and `configure_site()` would never be called.
     122         *
     123         * @todo - If no other problems crop up with new site creation by 2016-12-01, then all of the logging
     124         * that was added in r4254 can be removed, to make the code less cluttered and more readable.
     125         */
     126        if ( 1 !== did_action( 'wcpt_metabox_save_done' ) ) {
     127            Logger\log( 'return_redundant_call' );
     128            return;
     129        }
     130
    118131        if ( ! current_user_can( 'manage_sites' ) ) {
    119132            $current_user_id = get_current_user_id();
Note: See TracChangeset for help on using the changeset viewer.