PluginProbe ʕ •ᴥ•ʔ
پارسی دیت – Parsi Date / 6.2.1
پارسی دیت – Parsi Date v6.2.1
6.2.1 6.2 6.1 5.1.6 5.1.7 5.1.8 5.1.8.2 6.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.0.0-alpha 2.1 2.1.1 2.1.2 2.1.3 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0.1 2.3.0.2 2.3.1 2.3.2 2.3.3 2.3.4 3.0.1 3.0.2 3.0.3 4.0.0 4.0.1 4.0.2 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5
wp-parsidate / inc / Admin / AdminAssets.php
wp-parsidate / inc / Admin Last commit date
Admin.php 3 weeks ago AdminAbout.php 3 weeks ago AdminAssets.php 3 weeks ago AdminConvert.php 3 weeks ago AdminCore.php 3 weeks ago AdminDashboard.php 3 weeks ago AdminIntegration.php 3 weeks ago AdminPages.php 3 weeks ago AdminSettings.php 3 weeks ago AdminTools.php 3 weeks ago
AdminAssets.php
50 lines
1 <?php
2
3 namespace WPParsidate\Admin;
4
5 defined( 'ABSPATH' ) || exit;
6
7 use WPParsidate\Helper\{Assets, Nonce};
8
9 class AdminAssets {
10 public function __construct() {
11 add_action( 'admin_enqueue_scripts', array( $this, 'enqueueScripts' ) );
12 }
13
14 public function enqueueScripts(): void {
15 if ( ! AdminPages::isSettingPage() ) {
16 return;
17 }
18 $pluginVersion = Assets::getVersion();
19 $debugName = WP_PARSI_DEBUG_MODE ? '' : '.min';
20
21 //wp_enqueue_media();
22 //wp_enqueue_style( 'wp-color-picker' );
23 //wp_enqueue_script( 'wp-color-picker' );
24
25 wp_enqueue_style( WP_PARSI_KEY_SLUG . '-admin-style',
26 Assets::url( 'css-admin/admin-style' . $debugName . '.css' ), false, $pluginVersion );
27
28 wp_enqueue_script( WP_PARSI_KEY_SLUG . '-admin',
29 Assets::url( 'js-admin/script.min.js' ),
30 [
31 'jquery',
32 'jquery-ui-sortable',
33 ], $pluginVersion, [ 'in_footer' => true ] );
34
35 wp_localize_script( WP_PARSI_KEY_SLUG . '-admin', WP_PARSI_KEY_CAP, array(
36 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
37 'ajaxNonce' => Nonce::create(),
38 'pageRefreshedAfter' => apply_filters( 'wp_parsidate_settings_page_refreshed_after', 0 ),
39 'pageRefreshUrl' => apply_filters( 'wp_parsidate_settings_page_refresh_url', null ),
40 'removeText' => esc_html__( 'Remove', 'wp-parsidate' ),
41 'dtuConfirmDelete' => esc_html__( 'Are you sure you want to delete this item(s)?', 'wp-parsidate' ),
42 'copyText' => esc_html__( 'Click to copy this text.', 'wp-parsidate' ),
43 ) );
44 }
45
46 public static function imageUrl( $path ): string {
47 return WP_PARSI_URL . 'assets/images/' . $path;
48 }
49 }
50