Нет описания

social-logos.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 automattic/jetpack
  9. */
  10. /*
  11. * Those references to the social logos location can be updated
  12. * in other environments such as WordPress.com.
  13. */
  14. if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
  15. define( 'JETPACK_SOCIAL_LOGOS_URL', '/wp-content/mu-plugins/social-logos/' );
  16. define( 'JETPACK_SOCIAL_LOGOS_DIR', ABSPATH . JETPACK_SOCIAL_LOGOS_URL );
  17. } else {
  18. define( 'JETPACK_SOCIAL_LOGOS_URL', plugin_dir_url( __FILE__ ) . 'social-logos/' );
  19. define( 'JETPACK_SOCIAL_LOGOS_DIR', plugin_dir_path( __FILE__ ) . 'social-logos/' );
  20. }
  21. /**
  22. * Globally registers the 'social-logos' style and font.
  23. *
  24. * This ensures any theme or plugin using it is on the latest version of Social Logos, and helps to avoid conflicts.
  25. */
  26. function jetpack_register_social_logos() {
  27. if ( ! wp_style_is( 'social-logos', 'registered' ) ) {
  28. /** This filter is documented in modules/sharedaddy/sharing.php */
  29. $post_fix = apply_filters( 'jetpack_should_use_minified_assets', true ) ? '.min' : '';
  30. wp_register_style(
  31. 'social-logos',
  32. JETPACK_SOCIAL_LOGOS_URL . 'social-logos' . $post_fix . '.css',
  33. false,
  34. JETPACK__VERSION
  35. );
  36. }
  37. }
  38. add_action( 'init', 'jetpack_register_social_logos', 1 );