get_all_registered() as $block_name => $block_type ) { // Front-end script. if ( ! empty( $block_type->editor_script ) ) { wp_enqueue_script( $block_type->editor_script ); } } // Enqueue Scripts. $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; // Use minified libraries if SCRIPT_DEBUG is turned off. wp_enqueue_style( 'gutenberg-block-manager-styles', plugins_url( 'dist/css/style.css', __FILE__ ), array(), BLOCK_MANAGER_VERSION ); wp_enqueue_script( 'gutenberg-block-manager-admin', plugins_url( 'dist/js/gbm-admin' . $suffix . '.js', __FILE__ ), array( 'wp-blocks', 'wp-element', 'wp-data', 'wp-edit-post', 'wp-components', 'wp-block-library' ), BLOCK_MANAGER_VERSION, true ); // Localize Scripts. wp_localize_script( 'gutenberg-block-manager-admin', 'gbm_localize', array( 'disabledBlocks' => Gutenberg_Block_Manager::gbm_get_disabled_blocks(), 'filteredBlocks' => Gutenberg_Block_Manager::gbm_get_filtered_blocks(), 'root' => esc_url_raw( rest_url() ), 'nonce' => wp_create_nonce( 'wp_rest' ), 'enable' => __( 'Enable', 'gutenberg-block-manager' ), 'disable' => __( 'Disable', 'gutenberg-block-manager' ), 'enable_all' => __( 'Enable All', 'gutenberg-block-manager' ), 'disable_all' => __( 'Disable All', 'gutenberg-block-manager' ), 'toggle_all' => __( 'Toggle All Blocks', 'gutenberg-block-manager' ), 'toggle' => __( 'Toggle Block Activation', 'gutenberg-block-manager' ), 'search_label' => __( 'Filter Blocks', 'gutenberg-block-manager' ), 'submit' => __( 'Submit', 'gutenberg-block-manager' ), 'loading' => __( 'Loading Blocks', 'gutenberg-block-manager' ), 'loading_export' => __( 'Getting export data...', 'gutenberg-block-manager' ), 'copy' => __( 'Copy Code', 'gutenberg-block-manager' ), 'copied' => __( 'Copied', 'gutenberg-block-manager' ), 'close' => __( 'Close', 'gutenberg-block-manager' ), 'grid' => __( 'Grid', 'gutenberg-block-manager' ), 'list' => __( 'List', 'gutenberg-block-manager' ), 'export' => __( 'Export', 'gutenberg-block-manager' ), 'export_intro' => __( 'Add the the following code to your functions.php to remove blocks at the theme level.', 'gutenberg-block-manager' ), 'filtered_alert' => __( 'This block has been globally disabled via the `gbm_disabled_blocks` filter and cannot be activated.', 'gutenberg-block-manager' ), ) ); } /** * Register submenu item. * * @author ConnektMedia * @since 1.0 */ public function gbm_register_sub_menu() { add_submenu_page( 'options-general.php', esc_html__( 'Block Manager', 'gutenberg-block-manager' ), esc_html__( 'Block Manager', 'gutenberg-block-manager' ), apply_filters( 'gutenberg_block_manager_user_role', 'activate_plugins' ), 'gutenberg-block-manager', array( $this, 'gbm_submenu_page_callback' ) ); } /** * The Block Manager admin page. * * @author ConnektMedia * @since 1.0 */ public function gbm_submenu_page_callback() { ?>

--'); ?>

'ajax-load-more', ), array( 'slug' => 'easy-query', ), array( 'slug' => 'instant-images', ), array( 'slug' => 'velocity', ), ); ?>

', '' ); ?>