Making WordPress.org

Changeset 1562


Ignore:
Timestamp:
05/11/2015 08:53:42 PM (11 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Only substitute back-compat shortcodes on old sites.

The back-compat shortcodes were needed for existing sites at the time they were implemented, but there's no reason that new sites today can't use the real ones.

File:
1 edited

Legend:

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

    r1561 r1562  
    2222        // Initialize only if theme requires.
    2323        if ( in_array( $this->stylesheet, $compat_themes ) || in_array( $this->template, $compat_themes ) ) {
    24             add_action( 'wcpt_back_compat_init', array( $this, 'wcpt_back_compat_init' ) );
     24            $old_site_id       = get_current_blog_id() <= apply_filters( 'wcb_back_compat_max_site_id', 528 );
     25            $old_site_excepted = in_array( get_current_blog_id(), apply_filters( 'wcb_back_compat_site_id_exceptions', array( 465 ) ) ); // denver.wordcamp.org/2015
     26
     27            // Substitute back-compat shortcodes on older sites, but let new sites use the real ones
     28            if ( $old_site_id && ! $old_site_excepted ) {
     29                add_action( 'wcpt_back_compat_init', array( $this, 'wcpt_back_compat_init' ) );
     30            }
    2531
    2632            // Base theme should not load the following modules.
Note: See TracChangeset for help on using the changeset viewer.