瀏覽代碼

Use more reliable check for FSE

FSE contant will always be defined due to the fact that this
plugin bundles other functionality (SPT). Because of that we
can't rely on it to determine if this feature has been activated.
Marko Andrijasevic 6 年之前
父節點
當前提交
f046edf2d2
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      modern-business/footer.php
  2. 2 2
      modern-business/header.php

+ 2 - 2
modern-business/footer.php

@@ -17,14 +17,14 @@
 
 
 <?php
 <?php
 // If FSE plugin is active, use Footer template part for content.
 // If FSE plugin is active, use Footer template part for content.
-if( defined( 'A8C_FSE_VERSION' ) ) {
+if( class_exists( 'Full_Site_Editing' ) ) {
 	fse_get_footer();
 	fse_get_footer();
 }
 }
 
 
 // Otherwise we'll fall back to default Twenty Nineteen footer below.
 // Otherwise we'll fall back to default Twenty Nineteen footer below.
 ?>
 ?>
 
 
-<?php if( ! defined( 'A8C_FSE_VERSION' ) ) : ?>
+<?php if( ! class_exists( 'Full_Site_Editing' ) ) : ?>
 	<footer id="colophon" class="site-footer">
 	<footer id="colophon" class="site-footer">
 		<?php get_template_part( 'template-parts/footer/footer', 'widgets' ); ?>
 		<?php get_template_part( 'template-parts/footer/footer', 'widgets' ); ?>
 		<div class="site-info">
 		<div class="site-info">

+ 2 - 2
modern-business/header.php

@@ -26,14 +26,14 @@
 
 
     <?php
     <?php
         // If FSE plugin is active, use Header template part for content.
         // If FSE plugin is active, use Header template part for content.
-        if( defined( 'A8C_FSE_VERSION' ) ) {
+        if( class_exists( 'Full_Site_Editing' ) ) {
             fse_get_header();
             fse_get_header();
         }
         }
 
 
         // Otherwise we'll fall back to default Twenty Nineteen header below.
         // Otherwise we'll fall back to default Twenty Nineteen header below.
     ?>
     ?>
 
 
-    <?php if( ! defined( 'A8C_FSE_VERSION' ) ) : ?>
+    <?php if( ! class_exists( 'Full_Site_Editing' ) ) : ?>
 
 
         <header id="masthead" class="<?php echo is_singular() && twentynineteen_can_show_post_thumbnail() ? 'site-header featured-image' : 'site-header'; ?>">
         <header id="masthead" class="<?php echo is_singular() && twentynineteen_can_show_post_thumbnail() ? 'site-header featured-image' : 'site-header'; ?>">
             <div class="site-branding-container">
             <div class="site-branding-container">