wpcom.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 Lodestar
  8. */
  9. /**
  10. * Adds support for wp.com-specific theme functions.
  11. *
  12. * @global array $themecolors
  13. */
  14. function lodestar_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' => 'dddddd',
  21. 'text' => '333333',
  22. 'link' => '999999',
  23. 'url' => '999999',
  24. );
  25. }
  26. // Add print stylesheet.
  27. add_theme_support( 'print-style' );
  28. }
  29. add_action( 'after_setup_theme', 'lodestar_wpcom_setup' );
  30. /**
  31. * Enqueue wp.com-specific styles
  32. */
  33. function lodestar_wpcom_styles() {
  34. wp_enqueue_style( 'lodestar-wpcom', get_template_directory_uri() . '/inc/wpcom-style.css', '20160708' );
  35. }
  36. add_action( 'wp_enqueue_scripts', 'lodestar_wpcom_styles' );
  37. /**
  38. * Make sure any old assigned Jetpack logos are moved over to the Core logo spot.
  39. */
  40. function lodestar_move_logo() {
  41. if ( current_theme_supports( 'custom-logo' ) && ! get_theme_mod( 'custom_logo' ) && $jp_logo = get_option( 'site_logo' ) ) {
  42. set_theme_mod( 'custom_logo', $jp_logo );
  43. }
  44. }
  45. add_action( 'init', 'lodestar_move_logo' );