Making WordPress.org


Ignore:
Timestamp:
01/14/2015 11:35:51 PM (10 years ago)
Author:
iandunn
Message:

Central Theme: Link to a camp's page on Central if they don't have a website.

r1110 changed the template to link directly to the site, but some of the older camps don't have a URL set, so we need to fall back to their Central page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/themes/wordcamp-central-2012/functions.php

    r1142 r1143  
    628628        return $grouped_wordcamps;
    629629    }
     630
     631    /**
     632     * Returns a WordCamp's website URL if it's available, or their Central page if is isn't.
     633     *
     634     * @param int $post_id
     635     *
     636     * @return string
     637     */
     638    public static function get_best_wordcamp_url( $post_id = 0 ) {
     639        $url = wcpt_get_wordcamp_url( $post_id );
     640
     641        if ( ! filter_var( $url, FILTER_VALIDATE_URL ) ) {
     642            $url = wcpt_get_wordcamp_permalink( $post_id );
     643        }
     644
     645        return $url;
     646    }
    630647}
    631648
Note: See TracChangeset for help on using the changeset viewer.