Skip to content

Commit

Permalink
Create lifterlms-enable-block-visibility-header.js
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhogg authored Sep 24, 2024
1 parent 2ac0816 commit 047bd18
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Enable block visibility for the core/heading block.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion documentation for step-by-step directions on either method.
* https://lifterlms.com/docs/adding-custom-code/
*/
wp.hooks.addFilter(
'llms_block_supports_visibility',
'your-namespace/modify-visibility', // Unique namespace for your function
function( ret, settings, name ) {
// Check if the block name is 'core/heading'
if ( name === 'core/heading' ) {
// Return true to modify the visibility support
return true;
}
// Otherwise, return the original value
return ret;
}
);

0 comments on commit 047bd18

Please sign in to comment.