Astra_Theme_Extension::enqueue_admin_scripts()

Admin Scripts Callback


Description


Source

File: classes/class-astra-theme-extension.php

		public function enqueue_admin_scripts() {

			// Styles.
			wp_enqueue_style( 'ast-ext-admin-settings', ASTRA_EXT_URI . 'admin/assets/css/ast-ext-admin-settings.css', array(), ASTRA_EXT_VER );

			// Scripts.
			wp_enqueue_script( 'astra-ext-admin-settings', ASTRA_EXT_URI . 'admin/assets/js/ast-ext-admin-settings.js', array( 'jquery-ui-tooltip' ), ASTRA_EXT_VER, false );

			$options = array(
				'ajax_nonce'                 => wp_create_nonce( 'astra-addon-module-nonce' ),
				'activate'                   => __( 'Activate', 'astra-addon' ),
				'deactivate'                 => __( 'Deactivate', 'astra-addon' ),
				'enableBetaUpdates'          => __( 'Enable Beta Updates', 'astra-addon' ),
				'disableBetaUpdates'         => __( 'Disable Beta Updates', 'astra-addon' ),
				'enableFileGeneration'       => __( 'Enable File Generation', 'astra-addon' ),
				'disableFileGeneration'      => __( 'Disable File Generation', 'astra-addon' ),
				'assetsRefreshingButtonText' => __( 'Refreshing', 'astra-addon' ),
				'assetsRefreshedButtonText'  => __( 'Refreshed', 'astra-addon' ),
				'adminUrl'                   => admin_url( 'post-new.php?post_type=' ),
				'customLayoutText'           => __( 'Custom Layouts', 'astra-addon' ),
				'pageHeadersText'            => __( 'Page Headers', 'astra-addon' ),
			);

			wp_localize_script( 'astra-ext-admin-settings', 'astraAddonModules', $options );
		}

User Contributed Notes

You must log in before being able to contribute a note or feedback.