Przeglądaj źródła

Require theme files without assuming the theme is installed

Ben Dwyer 4 lat temu
rodzic
commit
c159bbf546
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      spearhead/inc/wpcom-colors.php

+ 2 - 1
spearhead/inc/wpcom-colors.php

@@ -1,6 +1,7 @@
 <?php
 <?php
 
 
-require_once get_template_directory() . '/inc/wpcom-colors-utils.php';
+// We can't assume that the theme is activated when this is called, so we can't rely on get_template_directory().
+require_once get_theme_root() . '/pub/seedlet/inc/wpcom-colors-utils.php';
 
 
 seedlet_define_color_annotations(
 seedlet_define_color_annotations(
 	array(
 	array(