Making WordPress.org

Changeset 1682


Ignore:
Timestamp:
06/19/2015 06:57:08 PM (10 years ago)
Author:
iandunn
Message:

Jetpack Tweaks: Use new namespace.

It was added in r1681.

File:
1 edited

Legend:

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

    r1681 r1682  
    88 * Provides a default image for sharing WordCamp home/pages to Facebook/Twitter/Google other than the Jetpack "blank" image.
    99 */
    10 function wc_default_og_image() {
     10function default_og_image() {
    1111    return 'https://s.w.org/images/backgrounds/wordpress-bg-medblue.png';
    1212}
    13 add_filter( 'jetpack_open_graph_image_default', 'wc_default_og_image' );
     13add_filter( 'jetpack_open_graph_image_default', __NAMESPACE__ . '\default_og_image' );
    1414
    1515/*
     
    1818 * Added the twitter:card = summary OG tag for the home page and other ! is_singular() pages, which is not added by default by Jetpack.
    1919 */
    20 function wc_add_og_twitter_summary( $og_tags ) {
     20function add_og_twitter_summary( $og_tags ) {
    2121    if ( is_home() || is_front_page() ) {
    2222        $og_tags['twitter:card'] = 'summary';
     
    2525    return $og_tags;
    2626}
    27 add_filter( 'jetpack_open_graph_tags', 'wc_add_og_twitter_summary' );
     27add_filter( 'jetpack_open_graph_tags', __NAMESPACE__ . '\add_og_twitter_summary' );
    2828
    2929/*
     
    3333 * Sets the "via" tag to blank to avoid slamming @WordCamp moderators with a ton of shared posts.
    3434 */
    35 function wc_twitter_sitetag( $site_tag ) {
     35function twitter_sitetag( $site_tag ) {
    3636    if ( 'jetpack' == $site_tag ) {
    3737        $site_tag = 'WordCamp';
     
    4141    return $site_tag;
    4242}
    43 add_filter( 'jetpack_twitter_cards_site_tag', 'wc_twitter_sitetag' );
     43add_filter( 'jetpack_twitter_cards_site_tag', __NAMESPACE__ . '\twitter_sitetag' );
    4444
    4545/*
    4646 * Determine which Jetpack modules should be automatically activated when new sites are created
    4747 */
    48 function wcorg_default_jetpack_modules( $modules ) {
     48function default_jetpack_modules( $modules ) {
    4949    $modules = array_diff( $modules, array( 'widget-visibility' ) );
    5050    array_push( $modules, 'contact-form', 'shortcodes', 'custom-css', 'subscriptions' );
     
    5252    return $modules;
    5353}
    54 add_filter( 'jetpack_get_default_modules', 'wcorg_default_jetpack_modules' );
     54add_filter( 'jetpack_get_default_modules', __NAMESPACE__ . '\default_jetpack_modules' );
    5555
    5656/*
Note: See TracChangeset for help on using the changeset viewer.