Created
June 5, 2024 13:11
-
-
Save markhowellsmead/0583d14aa083f0bf7fea1e774512f1a3 to your computer and use it in GitHub Desktop.
Add a do_action using the render_block filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace PT\MustUse\Blocks\CoreEmbed; | |
class Block | |
{ | |
public function run() | |
{ | |
add_filter('render_block_core/embed', [$this, 'render'], 10, 2); | |
} | |
public function render($html, $block) | |
{ | |
do_action('ptmustuse/blockbefore/core-embed', $html, $block); | |
return $html; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment