wpcom.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * WordPress.com-specific functions and definitions
  4. * This file is centrally included from `wp-content/mu-plugins/wpcom-theme-compat.php`.
  5. *
  6. * @package Pique
  7. */
  8. /**
  9. * Adds support for WP.com print styles and responsive videos
  10. */
  11. function pique_theme_support() {
  12. global $themecolors;
  13. /**
  14. * Set a default theme color array for WP.com.
  15. *
  16. * @global array $themecolors
  17. */
  18. if ( ! isset( $themecolors ) ) :
  19. $themecolors = array(
  20. 'bg' => 'fcfbf9',
  21. 'border' => 'c2beb9',
  22. 'text' => '666666',
  23. 'link' => '83b6cc',
  24. 'url' => '83b6cc',
  25. );
  26. endif;
  27. // Add support for print styles
  28. add_theme_support( 'print-style' );
  29. }
  30. add_action( 'after_setup_theme', 'pique_theme_support' );
  31. /**
  32. * Enqueue a WordPress.com-specific stylesheet
  33. */
  34. function pique_wpcom_styles() {
  35. wp_enqueue_style( 'pique-wpcom', get_template_directory_uri() . '/inc/style-wpcom.css', '20151008' );
  36. }
  37. add_action( 'wp_enqueue_scripts', 'pique_wpcom_styles' );
  38. /**
  39. * De-queue Google fonts if custom fonts are being used instead.
  40. */
  41. function pique_dequeue_fonts() {
  42. if ( class_exists( 'TypekitData' ) && class_exists( 'CustomDesign' ) && CustomDesign::is_upgrade_active() ) {
  43. $customfonts = TypekitData::get( 'families' );
  44. if ( $customfonts['headings']['id'] && $customfonts['body-text']['id'] ) {
  45. wp_dequeue_style( 'pique-fonts' );
  46. }
  47. }
  48. }
  49. add_action( 'wp_enqueue_scripts', 'pique_dequeue_fonts' );