Skip to content

Commit

Permalink
Remove Page Attributes metabox when BU Navigation is active.
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyCrews committed Apr 21, 2019
1 parent f2fe17c commit 61f6c49
Show file tree
Hide file tree
Showing 10 changed files with 1,277 additions and 6 deletions.
19 changes: 19 additions & 0 deletions admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ 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 @@ -68,6 +69,24 @@ 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
*/
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 61f6c49

Please sign in to comment.