Skip to content

Commit

Permalink
Merge pull request #44 from bu-ist/gutenberg-compatibility
Browse files Browse the repository at this point in the history
Gutenberg compatibility
  • Loading branch information
DannyCrews authored May 14, 2019
2 parents ccd069d + 61f6c49 commit 2e2116b
Show file tree
Hide file tree
Showing 10 changed files with 1,285 additions and 6 deletions.
27 changes: 27 additions & 0 deletions admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public function __construct( $plugin ) {
public function register_hooks() {
global $wp_version;

add_action( 'admin_enqueue_scripts', array( &$this, 'thickbox' ) );
add_action( 'enqueue_block_editor_assets', array( &$this, 'remove_bulb_attributes_panel' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );

// Components with menu items need to be registered for every admin request
Expand Down Expand Up @@ -67,6 +69,31 @@ public function register_hooks() {

}

/**
* Load script to kill attributes panel in Document editor panel.
*
* @since 1.3.0
*/
public function remove_bulb_attributes_panel() {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
$scripts_url = plugins_url( 'js', BU_NAV_PLUGIN );

wp_enqueue_script(
'remove-panel-js',
$scripts_url . '/remove_attributes_panel' . $suffix . '.js',
array(),
BU_Navigation_Plugin::VERSION,
true
);
}

/**
* Enqueue Thickbox for Gutenberg editor
*/
public function thickbox() {
add_thickbox();
}

public function admin_scripts() {

$screen = get_current_screen();
Expand Down
2 changes: 1 addition & 1 deletion js/bu-navigation.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/deletion.min.js

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

2 changes: 1 addition & 1 deletion js/manage.min.js

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

Loading

0 comments on commit 2e2116b

Please sign in to comment.