Making WordPress.org


Ignore:
Timestamp:
08/06/2015 12:09:36 AM (10 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Pull organizer username from $_POST instead of post meta.

$_POST will always contain the latest value, but post meta could be outdated if the value is changed during the same request that the post transitions from draft to pending. This often resulted in the organizer not being added because the field was empty, and then it was filled it at the same time that the post transitioned.

File:
1 edited

Legend:

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

    r1589 r1812  
    509509     */
    510510    public function add_organizer_to_central( $post ) {
    511         $lead_organizer = get_user_by( 'login', get_post_meta( $post->ID, 'WordPress.org Username', true ) );
     511        $lead_organizer = get_user_by( 'login', $_POST['wcpt_wordpress_org_username'] );
    512512
    513513        if ( $lead_organizer && add_user_to_blog( get_current_blog_id(), $lead_organizer->ID, 'contributor' ) ) {
Note: See TracChangeset for help on using the changeset viewer.