From 0194bb086ad00c72210460d535a1790ae7106fcf Mon Sep 17 00:00:00 2001 From: David Herrera Date: Tue, 5 Mar 2024 22:20:42 -0500 Subject: [PATCH 1/3] Bump dependencies --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6f117f4..3683f14 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "require": { "php": "^8.1", "alleyinteractive/composer-wordpress-autoloader": "^1.0", - "alleyinteractive/wp-bulk-task": "dev-main", + "alleyinteractive/wp-bulk-task": "^0.2", "alleyinteractive/wp-match-blocks": "^3.0", "alleyinteractive/wp-type-extensions": "^2.1" }, From 36f1661e8a9debb0c66a37804c165ec27772fe5b Mon Sep 17 00:00:00 2001 From: David Herrera Date: Tue, 30 Apr 2024 22:17:55 -0400 Subject: [PATCH 2/3] Pass post to example URL filter --- src/features/class-block-audit-command.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/features/class-block-audit-command.php b/src/features/class-block-audit-command.php index 9151942..d96c22f 100644 --- a/src/features/class-block-audit-command.php +++ b/src/features/class-block-audit-command.php @@ -12,6 +12,7 @@ use Alley\WP_Bulk_Task\Progress\Null_Progress_Bar; use Alley\WP_Bulk_Task\Progress\PHP_CLI_Progress_Bar; use WP_CLI; +use WP_Post; use function Alley\WP\match_blocks; use function WP_CLI\Utils\format_items; @@ -167,8 +168,9 @@ function ( \WP_Post $post ) use ( &$out ) { * Filters the example URL included for a block type. * * @param string $example_url The example URL. Defaults to the permalink of the post where the block type was first seen. + * @param WP_Post $post The post used to generate the example URL. */ - $example_url = apply_filters( 'alley_block_audit_block_type_example_url', get_permalink( $post ) ); + $example_url = apply_filters( 'alley_block_audit_block_type_example_url', get_permalink( $post ), $post ); $out[ $block_name ] = [ 'Block Name' => $block_name, From 70947e6213ecbcf9d88a357620437112b20af461 Mon Sep 17 00:00:00 2001 From: David Herrera Date: Tue, 30 Apr 2024 22:28:44 -0400 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03c1c05..e428be9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ This library adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/en/1.0.0/). +## 1.1.0 + +### Changed + +- The post object is now passed to the `alley_block_audit_block_type_example_url` filter. + ## 1.0.0 Initial release.