Making WordPress.org


Ignore:
Timestamp:
04/15/2016 01:50:06 PM (9 years ago)
Author:
kovshenin
Message:

WordCamp.org: Create a new site a bit later.

The wcpt_metabox_save action is a bit misleading because
it runs multiple times, so the multi-sponsor region is saved
after the WordCamp URL is saved, causing our "create site"
functionality to fail the first time.

This commit creates a new wcpt_metabox_save_done action which
is called when all metabox fields are saved. Moves the site
creation process to that new action.

File:
1 edited

Legend:

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

    r2898 r2962  
    5959    function metabox () {
    6060        do_action( 'wcpt_metabox' );
    61     }
    62 
    63     /**
    64      * metabox_save ()
    65      *
    66      * Pass the metabox values before saving
    67      *
    68      * @param int $post_id
    69      * @return int
    70      */
    71     function metabox_save ( $post_id ) {
    72         if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
    73             return $post_id;
    74 
    75         if ( !current_user_can( 'edit_post', $post_id ) )
    76             return $post_id;
    77 
    78         do_action( 'wcpt_metabox_save' );
    7961    }
    8062
     
    189171}
    190172endif; // class_exists check
    191 
    192 ?>
Note: See TracChangeset for help on using the changeset viewer.