WordPress.org

Making WordPress.org

Changeset 749


Ignore:
Timestamp:
07/10/2014 10:21:34 PM (7 years ago)
Author:
iandunn
Message:

Multi-Event Sponsors: Get region from $_POST if it exists.

If the WordCamp post is set to pending and the region is set to 'null', then an admin select a region and published
the post at the same time, 'null' was incorrectly used instead of the selected value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/multi-event-sponsors/classes/multi-event-sponsors.php

    r719 r749  
    165165    public function get_wordcamp_me_sponsors( $wordcamp_id, $grouped_by = 'ungrouped' ) {
    166166        $wordcamp_sponsors = array();
    167         $wordcamp_region   = get_post_meta( $wordcamp_id, 'Multi-Event Sponsor Region', true );
     167
     168        if ( ! empty( $_POST[ wcpt_key_to_str( 'Multi-Event Sponsor Region', 'wcpt_' ) ] ) ) {
     169            $wordcamp_region = absint( $_POST[ wcpt_key_to_str( 'Multi-Event Sponsor Region', 'wcpt_' ) ] );
     170        } else {
     171            $wordcamp_region = get_post_meta( $wordcamp_id, 'Multi-Event Sponsor Region', true );
     172        }
    168173
    169174        $all_me_sponsors = get_posts( array(
Note: See TracChangeset for help on using the changeset viewer.