Making WordPress.org

Changeset 7866


Ignore:
Timestamp:
11/16/2018 10:36:43 PM (6 years ago)
Author:
iandunn
Message:

WordCamp Canonical Years: Wait until current event is over to add link.

Fixes #3815
Props jonoaldersonwp, iandunn

File:
1 edited

Legend:

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

    r7865 r7866  
    3333            return;
    3434
     35        $wordcamp = get_wordcamp_post();
     36        $end_date = $wordcamp->meta['End Date (YYYY-mm-dd)'][0] ?? false;
     37
     38        /*
     39         * In rare cases, the site for next year's camp will be created before this year's camp is over. When that
     40         * happens, we should wait to add the canonical link until after the current year's camp is over.
     41         */
     42        if ( $end_date && time() < ( (int) $end_date + DAY_IN_SECONDS ) ) {
     43            return;
     44        }
     45
    3546        $current_domain = $matches[0];
    3647        $city_domain = $matches[2];
Note: See TracChangeset for help on using the changeset viewer.