-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create lifterlms-enable-block-visibility-header.js
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
lifterlms/blocks-shortcodes/lifterlms-enable-block-visibility-header.js
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
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; | ||
} | ||
); |