|
1 | 1 | <?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 | + |
2 | 23 | /**
|
3 | 24 | * Globally registers the 'social-logos' style and font.
|
4 | 25 | *
|
5 | 26 | * This ensures any theme or plugin using it is on the latest version of Social Logos, and helps to avoid conflicts.
|
6 | 27 | */
|
7 |
| -add_action( 'init', 'jetpack_register_social_logos', 1 ); |
8 | 28 | function jetpack_register_social_logos() {
|
9 | 29 | 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 | + ); |
12 | 38 | }
|
13 | 39 | }
|
14 |
| - |
| 40 | +add_action( 'init', 'jetpack_register_social_logos', 1 ); |
0 commit comments