Skip to content

Commit

Permalink
Social Logos: update library to prepare for Fusion (#15762)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve authored May 13, 2020
1 parent 7eca0ff commit db3e471
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
34 changes: 30 additions & 4 deletions _inc/social-logos.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
<?php
/**
* Social Logos
* Icon Font of the social logos we use on WordPress.com and in Jetpack
*
* Reference: https://github.com/Automattic/social-logos
*
* @package Jetpack
*/

/*
* Those references to the social logos location can be updated
* in other environments such as WordPress.com.
*/
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
define( 'JETPACK_SOCIAL_LOGOS_URL', '/wp-content/mu-plugins/social-logos/' );
define( 'JETPACK_SOCIAL_LOGOS_DIR', ABSPATH . JETPACK_SOCIAL_LOGOS_URL );
} else {
define( 'JETPACK_SOCIAL_LOGOS_URL', plugin_dir_url( __FILE__ ) . 'social-logos/' );
define( 'JETPACK_SOCIAL_LOGOS_DIR', plugin_dir_path( __FILE__ ) . 'social-logos/' );
}

/**
* Globally registers the 'social-logos' style and font.
*
* This ensures any theme or plugin using it is on the latest version of Social Logos, and helps to avoid conflicts.
*/
add_action( 'init', 'jetpack_register_social_logos', 1 );
function jetpack_register_social_logos() {
if ( ! wp_style_is( 'social-logos', 'registered' ) ) {
$post_fix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
wp_register_style( 'social-logos', plugins_url( 'social-logos/social-logos' . $post_fix . '.css', __FILE__ ), false, '1' );
/** This filter is documented in modules/sharedaddy/sharing.php */
$post_fix = apply_filters( 'jetpack_should_use_minified_assets', true ) ? '.min' : '';
wp_register_style(
'social-logos',
JETPACK_SOCIAL_LOGOS_URL . 'social-logos' . $post_fix . '.css',
false,
JETPACK__VERSION
);
}
}

add_action( 'init', 'jetpack_register_social_logos', 1 );
1 change: 1 addition & 0 deletions bin/phpcs-whitelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = [
'_inc/lib/core-api/wpcom-endpoints/memberships.php',
'_inc/lib/debugger/',
'_inc/lib/plans.php',
'_inc/social-logos.php',
'jetpack.php',
'json-endpoints/jetpack/class-jetpack-json-api-delete-backup-helper-script-endpoint.php',
'json-endpoints/jetpack/class-jetpack-json-api-install-backup-helper-script-endpoint.php',
Expand Down

0 comments on commit db3e471

Please sign in to comment.