wpcom.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * WordPress.com-specific functions and definitions.
  4. *
  5. * This file is centrally included from `wp-content/mu-plugins/wpcom-theme-compat.php`.
  6. *
  7. * @package Dara
  8. */
  9. /**
  10. * Adds support for wp.com-specific theme functions.
  11. *
  12. * @global array $themecolors
  13. */
  14. function dara_wpcom_setup() {
  15. global $themecolors;
  16. // Set theme colors for third party services.
  17. if ( ! isset( $themecolors ) ) {
  18. $themecolors = array(
  19. 'bg' => 'ffffff',
  20. 'border' => 'f2f2f2',
  21. 'text' => '444340',
  22. 'link' => '15b6b8',
  23. 'url' => '15b6b8',
  24. );
  25. }
  26. add_theme_support( 'print-style' );
  27. }
  28. add_action( 'after_setup_theme', 'dara_wpcom_setup' );
  29. /* WordPress.com specific styles*/
  30. function dara_wpcom_styles() {
  31. wp_enqueue_style( 'dara-wpcom-styles', get_template_directory_uri() . '/inc/style-wpcom.css', '26012017' );
  32. }
  33. add_action( 'wp_enqueue_scripts', 'dara_wpcom_styles' );
  34. /**
  35. * Flush the Rewrite Rules for the testimonials CPT after the user has activated the theme.
  36. */
  37. function dara_flush_rewrite_rules() {
  38. flush_rewrite_rules();
  39. }
  40. add_action( 'after_switch_theme', 'dara_flush_rewrite_rules' );