WordPress.org

Making WordPress.org

Changeset 1701


Ignore:
Timestamp:
07/03/2015 06:12:42 PM (5 years ago)
Author:
iandunn
Message:

WordCamp Helpers: Support retrieving the name of arbitrary sites.

Previously it only supported getting the name of the current site.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/helper-functions.php

    r1692 r1701  
    8181 * by using that and adding the year (if available).
    8282 *
     83 * @param int $site_id Optionally, get the name for a site other than the current one.
     84 *
    8385 * @return string
    8486 */
    85 function get_wordcamp_name() {
     87function get_wordcamp_name( $site_id = 0 ) {
    8688    $name = false;
     89
     90    switch_to_blog( $site_id );
    8791
    8892    if ( $wordcamp = get_wordcamp_post() ) {
     
    96100    }
    97101
     102    restore_current_blog();
     103
    98104    return $name;
    99105}
Note: See TracChangeset for help on using the changeset viewer.