Skip to content

Commit 047bd18

Browse files
authored
Create lifterlms-enable-block-visibility-header.js
1 parent 2ac0816 commit 047bd18

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Enable block visibility for the core/heading block.
3+
*
4+
* You can add this recipe to your site by creating a custom plugin
5+
* or using the Code Snippets plugin available for free in the WordPress repository.
6+
* Read this companion documentation for step-by-step directions on either method.
7+
* https://lifterlms.com/docs/adding-custom-code/
8+
*/
9+
wp.hooks.addFilter(
10+
'llms_block_supports_visibility',
11+
'your-namespace/modify-visibility', // Unique namespace for your function
12+
function( ret, settings, name ) {
13+
// Check if the block name is 'core/heading'
14+
if ( name === 'core/heading' ) {
15+
// Return true to modify the visibility support
16+
return true;
17+
}
18+
// Otherwise, return the original value
19+
return ret;
20+
}
21+
);

0 commit comments

Comments
 (0)