<?php
/**
 * File Path: includes/compat/compat-graphene-plus.php
 * Graphene Plus Theme Compatibility -- loaded when get_template() === 'graphene-plus'.
 * Findings reference: PATCHES/COMPAT-WORKLOG.md -- GX-001 through GX-007.
 * @package My_Book_Showroom
 * @since   1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * GX-004 -- wpautop bracket safety net.
 * graphene_do_custom_layout() removes and re-adds the wpautop filter in a bracket;
 * an early return between those calls leaves wpautop removed for the rest of the request,
 * stripping paragraph wrapping from MBS text sections. Priority 1001 restores it after.
 */
add_action( 'graphene_before_content', static function () {
	if ( ! has_filter( 'the_content', 'wpautop' ) ) {
		add_filter( 'the_content', 'wpautop' );
	}
}, 1001 );

/**
 * GX-003 note -- Bootstrap JS dequeue (no current MBS conflict).
 * graphene_compat_scripts() dequeues any handle whose src matches bootstrap.js.
 * MBS does not enqueue Bootstrap; if it ever does, register under 'mbs-bootstrap'
 * and re-enqueue at wp_print_scripts priority 1000. Full analysis in COMPAT-WORKLOG.md.
 */
