block delimiters — that is the Gutenberg * adapter's responsibility. * * Persist uses a direct SQL UPDATE on wp_posts (no wp_update_post) to avoid * hook/revision/RSS storms (architecture doc §9), followed by * clean_post_cache(). * * @since 1.0 * @package AILinkMaster * @subpackage AILinkMaster\modules\url-migrator */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } class AILM_Adapter_Classic implements AILM_Content_Adapter { /** * URL-bearing attributes to scan and rewrite. * * @var array */ private $url_attributes = array( 'href', 'src', 'data-src', 'data-url', 'data-href', 'action', 'poster' ); /** * Whether this adapter handles the given object. * * Handles 'post' objects that are NOT Elementor and NOT Gutenberg (i.e. * classic HTML content). * * @param string $object_type 'post' | 'term' | 'nav_menu'. * @param int $object_id Object ID. * @return bool */ public function supports( $object_type, $object_id ) { if ( 'post' !== $object_type || ! $object_id ) { return false; } // Elementor posts are handled by the Elementor adapter. if ( class_exists( 'AILM_Elementor_Handler' ) && AILM_Elementor_Handler::is_elementor_post( $object_id ) ) { return false; } // Gutenberg (block) posts are handled by the Gutenberg adapter. if ( self::is_gutenberg_post( $object_id ) ) { return false; } return true; } /** * Detect whether a post uses the block editor (Gutenberg). * * A post is considered Gutenberg if its content contains block delimiters * . This is the same heuristic WP core uses. * * @param int $post_id Post ID. * @return bool */ private static function is_gutenberg_post( $post_id ) { $post = get_post( $post_id ); if ( ! $post ) { return false; } return false !== strpos( (string) $post->post_content, '