wp_back/wp-content/plugins/visual-portfolio/gutenberg/extensions/stretch-for-saved-only.js

18 lines
357 B
JavaScript
Raw Normal View History

2024-05-20 15:37:46 +03:00
import { addFilter } from '@wordpress/hooks';
// Allow Stretch control on Saved Layouts editor only.
addFilter(
'vpf.editor.controls-render-data',
'vpf/editor/controls-render-data/customize-controls',
(data) => {
if (data.name === 'stretch' && !window.VPSavedLayoutVariables) {
data = {
...data,
skip: true,
};
}
return data;
}
);