Making WordPress.org


Ignore:
Timestamp:
08/08/2017 01:24:41 AM (8 years ago)
Author:
coreymckrill
Message:

WordCamp Sponsors: Integrate multi-event agreements in sponsor posts

Multi-event sponsors get copied to individual WC sites, but they
don't need to have a separate sponsor agreement for each camp.
Instead, this links to the multi-event agreement if one is available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php

    r5772 r5773  
    16971697        $agreement_url = wp_get_attachment_url( $agreement_id );
    16981698
     1699        $mes_id = get_post_meta( $sponsor->ID, '_mes_id', true );
     1700
     1701        if ( $mes_id ) {
     1702            switch_to_blog( BLOG_ID_CURRENT_SITE ); // central.wordcamp.org
     1703
     1704            $mes_agreement_id = get_post_meta( $mes_id, 'mes_sponsor_agreement', true );
     1705            if ( $mes_agreement_id ) {
     1706                $agreement_url = wp_get_attachment_url( $mes_agreement_id );
     1707            } else {
     1708                $agreement_url = '';
     1709            }
     1710
     1711            restore_current_blog();
     1712        }
     1713
    16991714        require_once( __DIR__ . '/views/sponsors/metabox-sponsor-agreement.php' );
    17001715    }
Note: See TracChangeset for help on using the changeset viewer.