+
+
+ >
+
+
get( 'TextDomain' );
- echo do_blocks( '' );
+ $theme = wp_get_theme();
+ $theme_slug = $theme->get( 'TextDomain' );
+ echo do_blocks( '' );
+ } else {
+ get_header();
+ }
} else {
- get_header();
+ // Standalone boilerplate — no theme header rendered.
+ ?>
+
+ >
+
+
+
+
+
+ >
+
+ , ) with no theme footer
+ * and no wp-site-blocks closing wrapper for block themes.
+ *
+ * All existing callers that pass no argument continue to work unchanged.
*
* @since 2.0.0
+ * @since 4.0.6 Added optional $show param to suppress the theme header/footer.
+ *
+ * @param bool $show Whether to render the active theme footer. Default true.
+ *
+ * @return void
*/
- public function tutor_custom_footer() {
+ public function tutor_custom_footer( bool $show = true ) {
global $wp_version;
- if ( version_compare( $wp_version, '5.9', '>=' ) && function_exists( 'wp_is_block_theme' ) && true === wp_is_block_theme() ) {
- $theme = wp_get_theme();
- $theme_slug = $theme->get( 'TextDomain' );
- echo do_blocks( '' );
- echo '
';
- wp_footer();
- echo '';
- echo '';
+ $is_block_theme = version_compare( $wp_version, '5.9', '>=' )
+ && function_exists( 'wp_is_block_theme' )
+ && true === wp_is_block_theme();
+
+ if ( $show ) {
+ if ( $is_block_theme ) {
+ $theme = wp_get_theme();
+ $theme_slug = $theme->get( 'TextDomain' );
+ echo do_blocks( '' );
+ echo '
';
+ wp_footer();
+ echo '';
+ echo '';
+ } else {
+ get_footer();
+ }
} else {
- get_footer();
+ // Standalone close — no theme footer rendered.
+ wp_footer();
+ ?>
+
+