diff --git a/composer.json b/composer.json index 4c1e881..80b9a4e 100644 --- a/composer.json +++ b/composer.json @@ -19,8 +19,8 @@ ] }, "require": { - "chubes4/html-to-blocks-converter": "dev-main", "php": "^8.1", + "chubes4/html-to-blocks-converter": "dev-main", "league/commonmark": "^2.5", "league/html-to-markdown": "^5.1" }, diff --git a/composer.lock b/composer.lock index 4f78e7c..6c42385 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fa21093e6f55653057bedf2e6a1e1b99", + "content-hash": "5e80def02c25e3d6bc32f7207b51fd81", "packages": [ { "name": "chubes4/html-to-blocks-converter", @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/chubes4/html-to-blocks-converter", - "reference": "94977024d4b676c723232d0a7c3b01c8563c224a" + "reference": "7336776a65393a1e6856de1c4dd87c0637d17ac2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/chubes4/html-to-blocks-converter/zipball/94977024d4b676c723232d0a7c3b01c8563c224a", - "reference": "94977024d4b676c723232d0a7c3b01c8563c224a", + "url": "https://api.github.com/repos/chubes4/html-to-blocks-converter/zipball/7336776a65393a1e6856de1c4dd87c0637d17ac2", + "reference": "7336776a65393a1e6856de1c4dd87c0637d17ac2", "shasum": "" }, "require": { @@ -41,7 +41,7 @@ ], "description": "Convert raw HTML into Gutenberg block arrays using WordPress' HTML API.", "homepage": "https://github.com/chubes4/html-to-blocks-converter", - "time": "2026-06-07T20:27:36+00:00" + "time": "2026-06-07T22:31:38+00:00" }, { "name": "dflydev/dot-access-data", diff --git a/includes/api.php b/includes/api.php index f80f2cd..b24b928 100644 --- a/includes/api.php +++ b/includes/api.php @@ -191,10 +191,10 @@ function bfb_convert_fragment( string $html, array $options = array() ): array { */ function bfb_h2bc_capabilities(): array { $handler = null; - if ( function_exists( '\BlockFormatBridge\Vendor\html_to_blocks_raw_handler' ) ) { - $handler = '\BlockFormatBridge\Vendor\html_to_blocks_raw_handler'; - } elseif ( function_exists( 'html_to_blocks_raw_handler' ) ) { + if ( function_exists( 'html_to_blocks_raw_handler' ) ) { $handler = 'html_to_blocks_raw_handler'; + } elseif ( function_exists( '\BlockFormatBridge\Vendor\html_to_blocks_raw_handler' ) ) { + $handler = '\BlockFormatBridge\Vendor\html_to_blocks_raw_handler'; } $path = null; @@ -253,8 +253,8 @@ function bfb_h2bc_capabilities(): array { */ function bfb_h2bc_capability_function(): ?string { $candidates = array( - '\BlockFormatBridge\Vendor\html_to_blocks_capabilities', 'html_to_blocks_capabilities', + '\BlockFormatBridge\Vendor\html_to_blocks_capabilities', ); $defined = get_defined_functions(); $functions = array_map( 'strtolower', $defined['user'] ); diff --git a/includes/class-bfb-html-adapter.php b/includes/class-bfb-html-adapter.php index 551993e..45d665f 100644 --- a/includes/class-bfb-html-adapter.php +++ b/includes/class-bfb-html-adapter.php @@ -65,13 +65,13 @@ public function to_blocks( string $content, array $options = array() ): array { return bfb_filter_html_to_blocks_result( $pre_result, $content, $options, $args ); } - if ( function_exists( '\BlockFormatBridge\Vendor\html_to_blocks_raw_handler' ) ) { - $blocks = \BlockFormatBridge\Vendor\html_to_blocks_raw_handler( $args ); + if ( function_exists( 'html_to_blocks_raw_handler' ) ) { + $blocks = html_to_blocks_raw_handler( $args ); return bfb_filter_html_to_blocks_result( is_array( $blocks ) ? $blocks : array(), $content, $options, $args ); } - if ( function_exists( 'html_to_blocks_raw_handler' ) ) { - $blocks = html_to_blocks_raw_handler( $args ); + if ( function_exists( '\BlockFormatBridge\Vendor\html_to_blocks_raw_handler' ) ) { + $blocks = \BlockFormatBridge\Vendor\html_to_blocks_raw_handler( $args ); return bfb_filter_html_to_blocks_result( is_array( $blocks ) ? $blocks : array(), $content, $options, $args ); }