We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The assets is in all pages. For the moment i use this snippet for remove assets if the block isn't in page.
/** * Completely remove assets from plugin block leaflet if isn't in page */ function disableLeafletAsset() { $id = get_the_ID(); if (!has_block('map-block-leaflet/map-block-leaflet', $id)) { wp_dequeue_script('lib-js-map-block-leaflet'); wp_dequeue_script('lib-js-map-block-leaflet-cluster'); wp_dequeue_script('js-editor-map-block-leaflet'); wp_dequeue_style('css-editor-map-block-leaflet'); wp_dequeue_style('lib-css-map-block-leaflet'); wp_dequeue_style('lib-css-map-block-leaflet-cluster'); } } add_action('wp_enqueue_scripts', 'disableLeafletAsset');
The text was updated successfully, but these errors were encountered:
Thanks for your contribution, in the past I had problems trying to exclude those assets. I will try your solution.
Sorry, something went wrong.
Added in version 2.1.0
No branches or pull requests
The assets is in all pages. For the moment i use this snippet for remove assets if the block isn't in page.
The text was updated successfully, but these errors were encountered: