File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1919 },
2020 "textdomain" : " stackable-ultimate-gutenberg-blocks" ,
2121 "stk-type" : " essential" ,
22- "stk-demo" : " https://wpstackable.com/columns-block/?utm_source=welcome&utm_medium=settings&utm_campaign=view_demo&utm_content=demolink"
22+ "stk-demo" : " https://wpstackable.com/columns-block/?utm_source=welcome&utm_medium=settings&utm_campaign=view_demo&utm_content=demolink" ,
23+ "stk-cannot-be-disabled" : true
2324}
Original file line number Diff line number Diff line change @@ -890,7 +890,12 @@ const Blocks = props => {
890890 const newDisabledBlocks = { }
891891 BLOCK_CATEROGIES . forEach ( ( { id } ) => {
892892 DERIVED_BLOCKS [ id ] . forEach ( block => {
893- newDisabledBlocks [ block . name ] = BLOCK_STATE . DISABLED
893+ // If the block cannot be disabled, default to hidden.
894+ if ( block [ 'stk-cannot-be-disabled' ] ) {
895+ newDisabledBlocks [ block . name ] = BLOCK_STATE . HIDDEN
896+ } else {
897+ newDisabledBlocks [ block . name ] = BLOCK_STATE . DISABLED
898+ }
894899 } )
895900 } )
896901 handleSettingsChange ( { stackable_block_states : newDisabledBlocks } ) // eslint-disable-line camelcase
@@ -1011,8 +1016,7 @@ const Blocks = props => {
10111016 < div className = "s-settings-grid" >
10121017 { DERIVED_BLOCKS [ id ] . map ( ( block , i ) => {
10131018 const blockState = disabledBlocks [ block . name ] ?? BLOCK_STATE . ENABLED
1014- // Do not allow the disabling of column
1015- const disabledValues = block . name === 'stackable/columns' ? [ BLOCK_STATE . DISABLED ] : null
1019+ const disabledValues = block [ 'stk-cannot-be-disabled' ] ? [ BLOCK_STATE . DISABLED ] : null
10161020
10171021 return (
10181022 < AdminToolbarSetting
You can’t perform that action at this time.
0 commit comments