From 36f1661e8a9debb0c66a37804c165ec27772fe5b Mon Sep 17 00:00:00 2001 From: David Herrera Date: Tue, 30 Apr 2024 22:17:55 -0400 Subject: [PATCH] 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,