Skip to content
New issue

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

Block Directory: Convert it to UI Plugin to avoid bundling into Core #17576

Merged
merged 9 commits into from
Oct 29, 2019
11 changes: 10 additions & 1 deletion bin/get-vendor-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,13 @@ function wp_add_inline_script() {}

require_once dirname( dirname( __FILE__ ) ) . '/lib/client-assets.php';

gutenberg_register_vendor_scripts();
/**
* Hi, phpcs
*/
function run_gutenberg_register_vendor_scripts() {
global $wp_scripts;

gutenberg_register_vendor_scripts( $wp_scripts );
}

run_gutenberg_register_vendor_scripts();
21 changes: 21 additions & 0 deletions lib/block-directory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* Block directory functions.
*
* @package gutenberg
*/

if (
gutenberg_is_experiment_enabled( 'gutenberg-block-directory' ) &&
! has_action( 'admin_enqueue_scripts', 'enqueue_block_editor_assets_block_directory' )
) {
/**
* Function responsible for enqueuing the assets required
* for the block directory functionality in the editor.
*/
function gutenberg_enqueue_block_editor_assets_block_directory() {
wp_enqueue_script( 'wp-block-directory' );
wp_enqueue_style( 'wp-block-directory' );
}
add_action( 'enqueue_block_editor_assets', 'gutenberg_enqueue_block_editor_assets_block_directory' );
gziolo marked this conversation as resolved.
Show resolved Hide resolved
}
Loading