<?php
/**
 * Third-party plugin compatibility
 *
 * Applies suppression filters against other schema-emitting plugins so
 * Solomon Schema is the single source of structured data on the site.
 *
 * @package BW_Schema
 * @since 3.2.0
 */

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

class BW_Schema_Compat {

	/**
	 * Register compatibility filters
	 *
	 * Called during plugins_loaded, before any frontend output.
	 *
	 * @return void
	 */
	public static function init() {
		// Yoast SEO: suppress its JSON-LD graph (Organization, WebSite,
		// BreadcrumbList…) when the Solomon Schema toggle says so. Yoast's
		// titles, meta tags, and sitemaps are unaffected — only schema.
		// The filter is Yoast's own supported kill-switch and is a no-op
		// when Yoast is not active.
		if ( BW_Schema_Service_Conflicts::is_yoast_schema_disabled() ) {
			add_filter( 'wpseo_json_ld_output', '__return_false' );
		}
	}
}
