Skip to content

Commit b3140f9

Browse files
authored
Merge pull request #9 from liip/develop
1.2.0
2 parents ff9bef3 + a27090e commit b3140f9

File tree

9 files changed

+114
-46
lines changed

9 files changed

+114
-46
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,25 @@ function my_row_default_attributes( $default_attributes ) {
138138
}
139139
```
140140

141+
### wp_bootstrap_blocks_enqueue_block_assets
142+
143+
Possibility to disable enqueuing block assets.
144+
145+
#### Parameters:
146+
147+
* `$enqueue_block_assets` (boolean) Defines if block assets should be enqueued.
148+
149+
#### Usage:
150+
151+
```php
152+
add_filter( 'wp_bootstrap_blocks_enqueue_block_assets', 'disable_enqueue_block_assets', 10, 1 );
153+
154+
function disable_enqueue_block_assets( $enqueue_block_assets ) {
155+
// Disable enqueuing block assets
156+
return false;
157+
}
158+
```
159+
141160
## JavaScript Filters
142161

143162
### wpBootstrapBlocks.button.styleOptions

composer.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/blocks.editor.build.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

languages/wp-bootstrap-blocks.pot

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
# This file is distributed under the same license as the Bootstrap Blocks plugin.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Bootstrap Blocks 1.1.0\n"
5+
"Project-Id-Version: Bootstrap Blocks 1.2.0\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-bootstrap-blocks\n"
77
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
88
"Language-Team: LANGUAGE <[email protected]>\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2019-06-19T08:25:34+00:00\n"
12+
"POT-Creation-Date: 2019-06-26T05:40:39+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.2.0\n"
1515
"X-Domain: wp-bootstrap-blocks\n"
1616

1717
#. Plugin Name of the plugin
18-
#: src/class-wp-bootstrap-blocks.php:170
18+
#: src/class-wp-bootstrap-blocks.php:183
1919
#: dist/blocks.build.js:1
2020
#: src/column/block.js:16
2121
#: src/container/block.js:47

package-lock.json

Lines changed: 56 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wp-bootstrap-blocks",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"private": true,
55
"scripts": {
66
"start": "cgb-scripts start",

readme.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: gutenberg, blocks, bootstrap
55
Requires at least: 5.0
66
Tested up to: 5.2.2
77
Requires PHP: 5.6
8-
Stable tag: 1.1.0
8+
Stable tag: 1.2.0
99
License: GPLv2
1010
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -67,6 +67,11 @@ Please create a new GitHub issue and let us know: [https://github.com/liip/boots
6767

6868
== Changelog ==
6969

70+
= 1.2.0 =
71+
72+
* [FIX] Fix enqueuing of script and style dependencies
73+
* [FEATURE] Added new filter `wp_bootstrap_blocks_enqueue_block_assets` to disable enqueuing block assets.
74+
7075
= 1.1.0 =
7176

7277
* [FEATURE] Added possibility to set background color on column block.

src/class-wp-bootstrap-blocks.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class WP_Bootstrap_Blocks {
3333
*
3434
* @var string
3535
*/
36-
public $version = '1.1.0';
36+
public $version = '1.2.0';
3737

3838
/**
3939
* The plugin token.
@@ -122,11 +122,16 @@ protected function init_hooks() {
122122
* Load frontend block assets.
123123
*/
124124
public function enqueue_block_assets() {
125+
$enqueue_block_assets = apply_filters( 'wp_bootstrap_blocks_enqueue_block_assets', true );
126+
if ( ! $enqueue_block_assets ) {
127+
return;
128+
}
129+
125130
// Styles.
126131
wp_enqueue_style(
127132
$this->token . '-styles', // Handle.
128133
esc_url( $this->assets_url ) . 'blocks.style.build.css', // Block style CSS.
129-
array( 'wp-editor' ), // Dependency to include the CSS after it.
134+
array(),
130135
$this->version
131136
);
132137
}
@@ -139,7 +144,15 @@ public function enqueue_block_editor_assets() {
139144
wp_enqueue_script(
140145
$this->token . '-js', // Handle.
141146
esc_url( $this->assets_url ) . 'blocks.build.js', // block.build.js: We register the block here. Built with Webpack.
142-
array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), // Dependencies, defined above.
147+
array(
148+
'wp-blocks',
149+
'wp-i18n',
150+
'wp-element',
151+
'wp-editor',
152+
'wp-components',
153+
'wp-data',
154+
'wp-hooks',
155+
),
143156
$this->version,
144157
true // Enqueue the script in the footer.
145158
);

wp-bootstrap-blocks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: Bootstrap 4 Gutenberg Blocks for WordPress.
66
* Author: Liip AG
77
* Author URI: https://liip.ch
8-
* Version: 1.1.0
8+
* Version: 1.2.0
99
* License: GPL2+
1010
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
1111
* Text Domain: wp-bootstrap-blocks

0 commit comments

Comments
 (0)