Skip to content

Commit

Permalink
Enhancement | Use filter to allow the custom block
Browse files Browse the repository at this point in the history
  • Loading branch information
dnwhte committed Apr 27, 2023
1 parent 477c239 commit 3d5eacf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions includes/html-snippet-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ public static function register_block()
)
);

add_filter(
'wsu_allowed_blocks_filter', function ( $blocks ) {
if (!in_array(self::$block_name, $blocks, true)) {
array_push($blocks, self::$block_name);
}

return $blocks;
}
);

}


Expand Down
2 changes: 1 addition & 1 deletion wsuwp-html-snippets.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
Plugin Name: WSU HTML Snippets
Version: 1.1.0
Version: 1.2.0
Description: Embed common HTML content throughout a WordPress site.
Author: washingtonstateuniversity, jeremyfelt
Author URI: https://web.wsu.edu/
Expand Down

0 comments on commit 3d5eacf

Please sign in to comment.