Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,25 @@ function my_row_default_attributes( $default_attributes ) {
}
```

### wp_bootstrap_blocks_enqueue_block_assets

Possibility to disable enqueuing block assets.

#### Parameters:

* `$enqueue_block_assets` (boolean) Defines if block assets should be enqueued.

#### Usage:

```php
add_filter( 'wp_bootstrap_blocks_enqueue_block_assets', 'disable_enqueue_block_assets', 10, 1 );

function disable_enqueue_block_assets( $enqueue_block_assets ) {
// Disable enqueuing block assets
return false;
}
```

## JavaScript Filters

### wpBootstrapBlocks.button.styleOptions
Expand Down
22 changes: 11 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/blocks.editor.build.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions languages/wp-bootstrap-blocks.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
# This file is distributed under the same license as the Bootstrap Blocks plugin.
msgid ""
msgstr ""
"Project-Id-Version: Bootstrap Blocks 1.1.0\n"
"Project-Id-Version: Bootstrap Blocks 1.2.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-bootstrap-blocks\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2019-06-19T08:25:34+00:00\n"
"POT-Creation-Date: 2019-06-26T05:40:39+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.2.0\n"
"X-Domain: wp-bootstrap-blocks\n"

#. Plugin Name of the plugin
#: src/class-wp-bootstrap-blocks.php:170
#: src/class-wp-bootstrap-blocks.php:183
#: dist/blocks.build.js:1
#: src/column/block.js:16
#: src/container/block.js:47
Expand Down
81 changes: 56 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wp-bootstrap-blocks",
"version": "1.1.0",
"version": "1.2.0",
"private": true,
"scripts": {
"start": "cgb-scripts start",
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: gutenberg, blocks, bootstrap
Requires at least: 5.0
Tested up to: 5.2.2
Requires PHP: 5.6
Stable tag: 1.1.0
Stable tag: 1.2.0
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

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

== Changelog ==

= 1.2.0 =

* [FIX] Fix enqueuing of script and style dependencies
* [FEATURE] Added new filter `wp_bootstrap_blocks_enqueue_block_assets` to disable enqueuing block assets.

= 1.1.0 =

* [FEATURE] Added possibility to set background color on column block.
Expand Down
19 changes: 16 additions & 3 deletions src/class-wp-bootstrap-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class WP_Bootstrap_Blocks {
*
* @var string
*/
public $version = '1.1.0';
public $version = '1.2.0';

/**
* The plugin token.
Expand Down Expand Up @@ -122,11 +122,16 @@ protected function init_hooks() {
* Load frontend block assets.
*/
public function enqueue_block_assets() {
$enqueue_block_assets = apply_filters( 'wp_bootstrap_blocks_enqueue_block_assets', true );
if ( ! $enqueue_block_assets ) {
return;
}

// Styles.
wp_enqueue_style(
$this->token . '-styles', // Handle.
esc_url( $this->assets_url ) . 'blocks.style.build.css', // Block style CSS.
array( 'wp-editor' ), // Dependency to include the CSS after it.
array(),
$this->version
);
}
Expand All @@ -139,7 +144,15 @@ public function enqueue_block_editor_assets() {
wp_enqueue_script(
$this->token . '-js', // Handle.
esc_url( $this->assets_url ) . 'blocks.build.js', // block.build.js: We register the block here. Built with Webpack.
array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor' ), // Dependencies, defined above.
array(
'wp-blocks',
'wp-i18n',
'wp-element',
'wp-editor',
'wp-components',
'wp-data',
'wp-hooks',
),
$this->version,
true // Enqueue the script in the footer.
);
Expand Down
2 changes: 1 addition & 1 deletion wp-bootstrap-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Bootstrap 4 Gutenberg Blocks for WordPress.
* Author: Liip AG
* Author URI: https://liip.ch
* Version: 1.1.0
* Version: 1.2.0
* License: GPL2+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: wp-bootstrap-blocks
Expand Down