mirror of
https://ghproxy.net/https://github.com/AlxMedia/alx-extensions.git
synced 2025-08-26 15:53:37 +08:00
Fix script loading
This commit is contained in:
parent
2d08a61506
commit
79eafe1fff
1 changed files with 5 additions and 3 deletions
|
@ -30,15 +30,17 @@ add_action( 'init', 'alx_ext_load_textdomain' );
|
|||
/* enqueue scripts */
|
||||
function alx_ext_enqueue_scripts() {
|
||||
if ( is_singular() ) {
|
||||
wp_enqueue_script( 'alx-ext-sharrre', ALX_EXTENSIONS_URL . '/js/jquery.sharrre.min.js', array( 'jquery' ), '1.0.0' );
|
||||
wp_enqueue_script( 'alx-ext-sharrre', ALX_EXTENSIONS_URL . '/js/jquery.sharrre.min.js', array( 'jquery' ), '1.0.1' );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'wp_enqueue_scripts', 'alx_ext_enqueue_scripts' );
|
||||
|
||||
/* enqueue admin scripts */
|
||||
function alx_ext_enqueue_admin_scripts() {
|
||||
wp_enqueue_script( 'alx-ext-post-formats', ALX_EXTENSIONS_URL . '/js/post-formats.js', array( 'jquery' ), '1.0.0' );
|
||||
function alx_ext_enqueue_admin_scripts( $hook ) {
|
||||
if ( in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) {
|
||||
wp_enqueue_script( 'alx-ext-post-formats', ALX_EXTENSIONS_URL . '/js/post-formats.js', array( 'jquery' ), '1.0.1' );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'admin_enqueue_scripts', 'alx_ext_enqueue_admin_scripts' );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue