feat: add CHRNX editorial metadata
This commit is contained in:
10 files changed
+1127
-1
No files matched your search
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Block editor assets.
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
|
||||
/**
|
||||
* Enqueue CHRNX controls only in the post block editor.
|
||||
*/
|
||||
function chrnx_enqueue_editor_assets() {
|
||||
$screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
|
||||
if ( ! $screen || 'post' !== $screen->base || 'post' !== $screen->post_type || ! $screen->is_block_editor() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_script(
|
||||
'chrnx-editor-taxonomies',
|
||||
get_theme_file_uri( 'assets/js/editor-taxonomies.js' ),
|
||||
array( 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-plugins' ),
|
||||
CHRNX_VERSION,
|
||||
true
|
||||
);
|
||||
|
||||
wp_enqueue_script(
|
||||
'chrnx-editor-podcast',
|
||||
get_theme_file_uri( 'assets/js/editor-podcast.js' ),
|
||||
array( 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-plugins' ),
|
||||
CHRNX_VERSION,
|
||||
true
|
||||
);
|
||||
}
|
||||
add_action( 'enqueue_block_editor_assets', 'chrnx_enqueue_editor_assets' );
|
||||
Reference in new issue
Block a user