Skip to content

Commit

Permalink
Pass post to example URL filter
Browse files Browse the repository at this point in the history
  • Loading branch information
dlh01 committed May 1, 2024
1 parent 0194bb0 commit 36f1661
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/features/class-block-audit-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 36f1661

Please sign in to comment.