浏览代码

Move setting migration code to an earlier hook to prevent a request without fonts

Grant Kinney 3 年之前
父节点
当前提交
d445c8988e
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      blockbase/inc/customizer/wp-customize-fonts.php

+ 2 - 1
blockbase/inc/customizer/wp-customize-fonts.php

@@ -3,7 +3,8 @@
 require_once( __DIR__ . '/wp-customize-global-styles-setting.php' );
 require_once( __DIR__ . '/wp-customize-utils.php' );
 
-add_action( 'init', 'migrate_blockbase_custom_fonts' );
+// Use an early priority to migrate legacy font settings before registering Google Fonts in `blockbase_register_google_fonts`.
+add_action( 'after_setup_theme', 'migrate_blockbase_custom_fonts', 0 );
 
 function migrate_blockbase_custom_fonts() {
 	// The data has already been transformed