layers_admin_scripts
The Layers layers admin scripts function.
Description
layers_admin_scripts();
Usage
if ( !function_exists( 'layers_admin_scripts' ) ) { require_once '/functions.php'; } // NOTICE! Understand what this does before running. $result = layers_admin_scripts();
Defined (1)
The function is defined in the following location(s).
- /functions.php
- function layers_admin_scripts() {
- global $pagenow, $wp_customize;
- /**
- * Tip-Tip (renamed to layerTip )
- */
- wp_enqueue_style(
- LAYERS_THEME_SLUG . '-tip-tip' ,
- get_template_directory_uri() . '/core/assets/plugins/tip-tip/jquery.tipTip.css',
- array(),
- );
- wp_enqueue_script(
- LAYERS_THEME_SLUG . '-tip-tip' ,
- get_template_directory_uri() . '/core/assets/plugins/tip-tip/jquery.tipTip.js',
- array( 'jquery' ),
- true
- );
- /**
- * LayersSlct2 (also enqueued by Storekit and WooCommerce).
- */
- wp_enqueue_style(
- 'layersSlct2',
- get_template_directory_uri() . '/core/assets/plugins/select2/layersSlct2.css',
- array(),
- );
- wp_enqueue_style(
- 'layersSlct2-skins',
- get_template_directory_uri() . '/core/assets/plugins/select2/layersSlct2-skins.css',
- array(),
- );
- wp_enqueue_script(
- 'layersSlct2',
- get_template_directory_uri() . '/core/assets/plugins/select2/layersSlct2.js',
- array( 'jquery' ),
- );
- /**
- * FontAwesome
- */
- wp_enqueue_style(
- LAYERS_THEME_SLUG . '-admin-font-awesome',
- get_template_directory_uri() . '/core/assets/plugins/font-awesome/font-awesome.min.css',
- array(),
- );
- /**
- * Main Admin CSS's
- */
- wp_enqueue_style(
- LAYERS_THEME_SLUG . '-global',
- get_template_directory_uri() . '/core/assets/layers-global.css',
- array(),
- );
- if ( isset( $wp_customize ) ) {
- /**
- * Admin Customizer (only)
- */
- wp_enqueue_style(
- LAYERS_THEME_SLUG . '-customizer',
- get_template_directory_uri() . '/core/assets/layers-customizer.css',
- array(),
- );
- }
- else {
- /**
- * Admin Dashboard (only)
- */
- wp_enqueue_style(
- LAYERS_THEME_SLUG . '-admin',
- get_template_directory_uri() . '/core/assets/layers-admin.css',
- array(),
- );
- }
- /**
- * Admin Editor
- */
- wp_enqueue_style(
- LAYERS_THEME_SLUG . '-admin-editor',
- get_template_directory_uri() . '/core/assets/plugins/froala/editor.css',
- array(),
- );
- wp_enqueue_script(
- LAYERS_THEME_SLUG . '-admin-editor' ,
- get_template_directory_uri() . '/core/assets/plugins/froala/editor.min.js' ,
- array( 'jquery' ),
- true
- );
- /**
- * Admin Migrator
- */
- wp_enqueue_script(
- LAYERS_THEME_SLUG . '-admin-migrator' ,
- get_template_directory_uri() . '/core/assets/migrator.js' ,
- array(
- 'media-upload'
- ),
- true
- );
- wp_localize_script(
- LAYERS_THEME_SLUG . '-admin-migrator',
- 'migratori18n',
- array(
- 'loading_message' => __( 'Be patient while we import the widget data and images.' , 'layerswp' ),
- 'complete_message' => __( 'Import Complete' , 'layerswp' ),
- 'importing_message' => __( 'Importing Your Content' , 'layerswp' ),
- 'duplicate_complete_message' => __( 'Edit Your New Page' , 'layerswp' )
- )
- );
- wp_localize_script(
- LAYERS_THEME_SLUG . '-admin-migrator',
- "layers_migrator_params",
- array(
- 'duplicate_layout_nonce' => wp_create_nonce( 'layers-migrator-duplicate' ),
- 'import_layout_nonce' => wp_create_nonce( 'layers-migrator-import' ),
- 'preset_layout_nonce' => wp_create_nonce( 'layers-migrator-preset-layouts' ),
- )
- );
- /**
- * Discover More Photos
- */
- wp_enqueue_script(
- LAYERS_THEME_SLUG . '-media-views' ,
- get_template_directory_uri() . '/core/assets/media-views.js',
- array(
- 'media-views'
- ),
- );
- /**
- * Admin Onboarding
- */
- wp_enqueue_script(
- LAYERS_THEME_SLUG . '-admin-onboarding' ,
- get_template_directory_uri() . '/core/assets/onboarding.js',
- array(
- 'jquery'
- ),
- true
- );
- wp_localize_script(
- LAYERS_THEME_SLUG . '-admin-onboarding' ,
- "layers_onboarding_params",
- array(
- 'preset_layout_nonce' => wp_create_nonce( 'layers-migrator-preset-layouts' ),
- 'update_option_nonce' => wp_create_nonce( 'layers-onboarding-update-options' ),
- 'set_theme_mod_nonce' => wp_create_nonce( 'layers-onboarding-set-theme-mods' ),
- )
- );
- wp_localize_script(
- LAYERS_THEME_SLUG . '-admin-onboarding' ,
- 'onboardingi18n',
- array(
- 'step_saving_message' => __( 'Saving...' , 'layerswp' ),
- 'step_done_message' => __( 'Done!' , 'layerswp' )
- )
- );
- /**
- * Admin JS
- */
- wp_enqueue_script(
- LAYERS_THEME_SLUG . '-admin' ,
- get_template_directory_uri() . '/core/assets/admin.js',
- array(
- 'jquery',
- 'jquery-ui-sortable',
- 'wp-color-picker',
- ),
- true
- );
- wp_localize_script(
- LAYERS_THEME_SLUG . '-admin' ,
- 'layers_admin_params',
- array(
- 'backup_pages_nonce' => wp_create_nonce( 'layers-backup-pages' ),
- 'backup_pages_success_message' => __('Your pages have been successfully backed up!', 'layerswp' ),
- 'nonce_layers_widget_linking' => wp_create_nonce( 'nonce_layers_widget_linking' ),
- )
- );
- wp_enqueue_media();
- }