Changeset 1682
- Timestamp:
- 06/19/2015 06:57:08 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/jetpack-tweaks.php
r1681 r1682 8 8 * Provides a default image for sharing WordCamp home/pages to Facebook/Twitter/Google other than the Jetpack "blank" image. 9 9 */ 10 function wc_default_og_image() {10 function default_og_image() { 11 11 return 'https://s.w.org/images/backgrounds/wordpress-bg-medblue.png'; 12 12 } 13 add_filter( 'jetpack_open_graph_image_default', 'wc_default_og_image' );13 add_filter( 'jetpack_open_graph_image_default', __NAMESPACE__ . '\default_og_image' ); 14 14 15 15 /* … … 18 18 * Added the twitter:card = summary OG tag for the home page and other ! is_singular() pages, which is not added by default by Jetpack. 19 19 */ 20 function wc_add_og_twitter_summary( $og_tags ) {20 function add_og_twitter_summary( $og_tags ) { 21 21 if ( is_home() || is_front_page() ) { 22 22 $og_tags['twitter:card'] = 'summary'; … … 25 25 return $og_tags; 26 26 } 27 add_filter( 'jetpack_open_graph_tags', 'wc_add_og_twitter_summary' );27 add_filter( 'jetpack_open_graph_tags', __NAMESPACE__ . '\add_og_twitter_summary' ); 28 28 29 29 /* … … 33 33 * Sets the "via" tag to blank to avoid slamming @WordCamp moderators with a ton of shared posts. 34 34 */ 35 function wc_twitter_sitetag( $site_tag ) {35 function twitter_sitetag( $site_tag ) { 36 36 if ( 'jetpack' == $site_tag ) { 37 37 $site_tag = 'WordCamp'; … … 41 41 return $site_tag; 42 42 } 43 add_filter( 'jetpack_twitter_cards_site_tag', 'wc_twitter_sitetag' );43 add_filter( 'jetpack_twitter_cards_site_tag', __NAMESPACE__ . '\twitter_sitetag' ); 44 44 45 45 /* 46 46 * Determine which Jetpack modules should be automatically activated when new sites are created 47 47 */ 48 function wcorg_default_jetpack_modules( $modules ) {48 function default_jetpack_modules( $modules ) { 49 49 $modules = array_diff( $modules, array( 'widget-visibility' ) ); 50 50 array_push( $modules, 'contact-form', 'shortcodes', 'custom-css', 'subscriptions' ); … … 52 52 return $modules; 53 53 } 54 add_filter( 'jetpack_get_default_modules', 'wcorg_default_jetpack_modules' );54 add_filter( 'jetpack_get_default_modules', __NAMESPACE__ . '\default_jetpack_modules' ); 55 55 56 56 /*
Note: See TracChangeset
for help on using the changeset viewer.