create-block-theme/includes/class-create-block-theme-editor-tools.php
Madhu Dollu 2c63cdc4b4
Update modal width to 65vw (#638)
* update modal width to 65vw

* set the modal size to large

* update wp_enqueue_style arguments

Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>

---------

Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
Co-authored-by: Jason Crist <jcrist@pbking.com>
Co-authored-by: Matias Benedetto <matias.benedetto@gmail.com>
2024-05-30 13:04:42 +02:00

44 lines
1.1 KiB
PHP

<?php
/**
* The Editor integration for the Create Block Theme plugin.
* @since 2.2.0
* @package Create_Block_Theme
* @subpackage Create_Block_Theme/includes
* @author WordPress.org
*/
class CBT_Editor_Tools {
public function __construct() {
add_action( 'enqueue_block_editor_assets', array( $this, 'create_block_theme_sidebar_enqueue' ) );
}
function create_block_theme_sidebar_enqueue() {
global $pagenow;
if ( 'site-editor.php' !== $pagenow ) {
return;
}
$asset_file = include plugin_dir_path( dirname( __FILE__ ) ) . 'build/plugin-sidebar.asset.php';
wp_register_script(
'create-block-theme-slot-fill',
plugins_url( 'build/plugin-sidebar.js', dirname( __FILE__ ) ),
$asset_file['dependencies'],
$asset_file['version']
);
wp_enqueue_style(
'create-block-theme-styles',
plugins_url( 'build/plugin-sidebar.css', dirname( __FILE__ ) ),
array(),
$asset_file['version']
);
wp_enqueue_script(
'create-block-theme-slot-fill',
);
// Enable localization in the plugin sidebar.
wp_set_script_translations( 'create-block-theme-slot-fill', 'create-block-theme' );
}
}