Skip to content

Commit db3e471

Browse files
authored
Social Logos: update library to prepare for Fusion (#15762)
1 parent 7eca0ff commit db3e471

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

_inc/social-logos.php

+30-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,40 @@
11
<?php
2+
/**
3+
* Social Logos
4+
* Icon Font of the social logos we use on WordPress.com and in Jetpack
5+
*
6+
* Reference: https://github.com/Automattic/social-logos
7+
*
8+
* @package Jetpack
9+
*/
10+
11+
/*
12+
* Those references to the social logos location can be updated
13+
* in other environments such as WordPress.com.
14+
*/
15+
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
16+
define( 'JETPACK_SOCIAL_LOGOS_URL', '/wp-content/mu-plugins/social-logos/' );
17+
define( 'JETPACK_SOCIAL_LOGOS_DIR', ABSPATH . JETPACK_SOCIAL_LOGOS_URL );
18+
} else {
19+
define( 'JETPACK_SOCIAL_LOGOS_URL', plugin_dir_url( __FILE__ ) . 'social-logos/' );
20+
define( 'JETPACK_SOCIAL_LOGOS_DIR', plugin_dir_path( __FILE__ ) . 'social-logos/' );
21+
}
22+
223
/**
324
* Globally registers the 'social-logos' style and font.
425
*
526
* This ensures any theme or plugin using it is on the latest version of Social Logos, and helps to avoid conflicts.
627
*/
7-
add_action( 'init', 'jetpack_register_social_logos', 1 );
828
function jetpack_register_social_logos() {
929
if ( ! wp_style_is( 'social-logos', 'registered' ) ) {
10-
$post_fix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
11-
wp_register_style( 'social-logos', plugins_url( 'social-logos/social-logos' . $post_fix . '.css', __FILE__ ), false, '1' );
30+
/** This filter is documented in modules/sharedaddy/sharing.php */
31+
$post_fix = apply_filters( 'jetpack_should_use_minified_assets', true ) ? '.min' : '';
32+
wp_register_style(
33+
'social-logos',
34+
JETPACK_SOCIAL_LOGOS_URL . 'social-logos' . $post_fix . '.css',
35+
false,
36+
JETPACK__VERSION
37+
);
1238
}
1339
}
14-
40+
add_action( 'init', 'jetpack_register_social_logos', 1 );

bin/phpcs-whitelist.js

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module.exports = [
2828
'_inc/lib/core-api/wpcom-endpoints/memberships.php',
2929
'_inc/lib/debugger/',
3030
'_inc/lib/plans.php',
31+
'_inc/social-logos.php',
3132
'jetpack.php',
3233
'json-endpoints/jetpack/class-jetpack-json-api-delete-backup-helper-script-endpoint.php',
3334
'json-endpoints/jetpack/class-jetpack-json-api-install-backup-helper-script-endpoint.php',

0 commit comments

Comments
 (0)