PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.9
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.9
7.8.14 7.8.14.1 7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / inc / class-hustle-admin-page-abstract.php
wordpress-popup / inc Last commit date
display-conditions 3 years ago front 10 months ago helpers 10 months ago metas 3 years ago multisite 3 years ago palettes 3 years ago provider 3 years ago providers 10 months ago templates 3 years ago update 3 years ago class-hustle-admin-page-abstract.php 10 months ago class-hustle-black-friday-campaign.php 7 months ago class-hustle-condition-factory.php 6 years ago class-hustle-cross-sell.php 10 months ago class-hustle-dashboard-admin.php 3 years ago class-hustle-data.php 3 years ago class-hustle-db.php 2 years ago class-hustle-installer.php 4 years ago class-hustle-meta.php 3 years ago class-hustle-module-admin.php 10 months ago class-hustle-module-collection.php 3 years ago class-hustle-module-page-abstract.php 2 years ago class-hustle-notifications.php 3 years ago class-hustle-settings-admin.php 3 years ago class-hustle-tutorials-page.php 4 years ago class-hustle-wp-dashboard-page.php 3 years ago hustle-deletion.php 3 years ago hustle-embedded-admin.php 3 years ago hustle-entries-admin.php 3 years ago hustle-entry-model.php 3 years ago hustle-general-data-protection.php 3 years ago hustle-init.php 7 months ago hustle-mail.php 3 years ago hustle-migration.php 3 years ago hustle-model.php 3 years ago hustle-module-model.php 10 months ago hustle-module-widget-legacy.php 3 years ago hustle-module-widget.php 3 years ago hustle-modules-common-admin-ajax.php 10 months ago hustle-popup-admin.php 3 years ago hustle-providers-admin.php 3 years ago hustle-providers.php 3 years ago hustle-settings-admin-ajax.php 3 years ago hustle-settings-page.php 3 years ago hustle-slidein-admin.php 3 years ago hustle-sshare-admin.php 3 years ago hustle-sshare-model.php 3 years ago hustle-tracking-model.php 3 years ago opt-in-geo.php 10 months ago opt-in-utils.php 3 years ago opt-in-wpmudev-api.php 3 years ago
class-hustle-admin-page-abstract.php
651 lines
1 <?php
2 /**
3 * File for Hustle_Admin_Page_Abstract class.
4 *
5 * @package Hustle
6 * @since 4.0.1
7 */
8
9 if ( ! class_exists( 'Hustle_Admin_Page_Abstract' ) ) :
10 /**
11 * Class Hustle_Admin_Page_Abstract.
12 * This is the base class for all Hustle's pages.
13 *
14 * @since 4.0.1
15 */
16 abstract class Hustle_Admin_Page_Abstract {
17
18 /**
19 * Page slug defined by us.
20 *
21 * @since 4.0.1
22 * @var string
23 */
24 protected $page;
25
26 /**
27 * Template path for the page relative to the 'views' folder.
28 *
29 * @since 4.0.1
30 * @var string
31 */
32 protected $page_template_path;
33
34 /**
35 * Page title.
36 *
37 * @since 4.0.1
38 * @var string
39 */
40 protected $page_title;
41
42 /**
43 * Page title for the WordPress menu.
44 *
45 * @since 4.0.1
46 * @var string
47 */
48 protected $page_menu_title;
49
50 /**
51 * Required capability for the page to be available.
52 *
53 * @since 4.0.1
54 * @var string
55 */
56 protected $page_capability;
57
58 /**
59 * The current page that's being requested.
60 *
61 * @since 4.0.2
62 * @var string|bool
63 */
64 protected $current_page;
65
66 /**
67 * Page slug defined by WordPress when registering the page.
68 *
69 * @since 4.0.0
70 * @var string
71 */
72 protected $page_slug;
73
74 /**
75 * Instance of Hustle_Layout_Helper
76 *
77 * @since 4.2.0
78 * @var Hustle_Layout_Helper
79 */
80 private $renderer;
81
82 /**
83 * Class constructor.
84 *
85 * @since 4.0.1
86 */
87 public function __construct() {
88
89 $this->current_page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_SPECIAL_CHARS );
90
91 $this->init();
92
93 add_action( 'admin_menu', array( $this, 'register_admin_menu' ) );
94 }
95
96 /**
97 * Initiate the page's properties
98 * Should be overridden by each page.
99 *
100 * @since 4.0.1
101 */
102 abstract protected function init();
103
104 /**
105 * Register the admin menus.
106 *
107 * @since 4.0.1
108 */
109 public function register_admin_menu() {
110 $this->page_slug = add_submenu_page( 'hustle', $this->page_title, esc_html( $this->page_menu_title ), $this->page_capability, $this->page, array( $this, 'render_main_page' ) );
111
112 add_action( 'admin_init', array( $this, 'maybe_export' ) );
113 add_action( 'load-' . $this->page_slug, array( $this, 'current_page_loaded' ) );
114 }
115
116 /**
117 * Gets an instance of the renderer class.
118 *
119 * @since 4.2.1
120 * @return Hustle_Layout_Helper
121 */
122 protected function get_renderer() {
123 if ( ! $this->renderer ) {
124 $this->renderer = new Hustle_Layout_Helper( $this );
125 }
126 return $this->renderer;
127 }
128
129 /**
130 * Check if it's export - run the relevant action.
131 */
132 public function maybe_export() {
133 $this->export_module();
134 }
135
136 /**
137 * Render the main page
138 *
139 * @since 4.0.1
140 */
141 public function render_main_page() {
142 ?>
143 <div class="<?php echo esc_attr( $this->get_sui_wrap_class() ); ?>">
144
145 <?php
146 $template_args = $this->get_page_template_args();
147 $renderer = $this->get_renderer();
148 $renderer->render( $this->page_template_path, $template_args );
149
150 $this->render_modals();
151 ?>
152
153 </div>
154 <?php
155 }
156
157 /**
158 * Perform actions during the 'load-{page}' hook.
159 *
160 * @since 4.0.4
161 */
162 public function current_page_loaded() {
163 $this->maybe_export();
164 add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ), 99 );
165 add_action( 'admin_print_styles', array( $this, 'register_styles' ) );
166 add_filter( 'admin_body_class', array( $this, 'add_admin_body_class' ), 99 );
167 add_filter( 'removable_query_args', array( $this, 'remove_notice_params' ) );
168 }
169
170 /**
171 * Print forminator scripts for preview.
172 * Used by Dashboard, Wizards, and Listings.
173 *
174 * @since 4.0.1
175 */
176 public function maybe_print_forminator_scripts() {
177
178 // Add Forminator's front styles and scripts for preview.
179 if ( defined( 'FORMINATOR_VERSION' ) ) {
180 forminator_print_front_styles( FORMINATOR_VERSION );
181 forminator_print_front_scripts( FORMINATOR_VERSION );
182
183 }
184 }
185
186 /**
187 * Register scripts for the admin page.
188 *
189 * @since 4.3.1
190 *
191 * @param string $page_slug Page slug.
192 */
193 public function register_scripts( $page_slug ) {
194
195 wp_enqueue_script(
196 'shared-ui',
197 Opt_In::$plugin_url . 'assets/js/shared-ui.min.js',
198 array( 'jquery' ),
199 HUSTLE_SUI_VERSION,
200 true
201 );
202
203 wp_enqueue_script(
204 'shared-tutorials',
205 Opt_In::$plugin_url . 'assets/js/shared-tutorials.min.js',
206 '',
207 HUSTLE_SUI_VERSION,
208 true
209 );
210
211 /**
212 * Filters the variable to be localized into the js side of Hustle's admin pages.
213 *
214 * @since unknown
215 */
216 $optin_vars = apply_filters( 'hustle_optin_vars', $this->get_vars_to_localize() );
217
218 wp_register_script(
219 'optin_admin_scripts',
220 Opt_In::$plugin_url . 'assets/js/admin.min.js',
221 array( 'jquery', 'backbone', 'jquery-effects-core' ),
222 Opt_In::VERSION,
223 true
224 );
225 wp_localize_script( 'optin_admin_scripts', 'optinVars', $optin_vars );
226 wp_enqueue_script( 'optin_admin_scripts' );
227 }
228
229 /**
230 * Register the js variables to be localized for this page.
231 *
232 * @since 4.3.1
233 *
234 * @return array
235 */
236 protected function get_vars_to_localize() {
237 $tutorials_removed = sprintf( /* translators: %1$s - plugin name, %2$s - opening <a> tag, %3$s - closing <a> tag */
238 esc_html__( 'The widget has been removed. %1$s tutorials can still be found in the %2$sTutorials tab%3$s any time.', 'hustle' ),
239 Opt_In_Utils::get_plugin_name(),
240 '<a href=' . esc_url( menu_page_url( 'hustle_tutorials', false ) ) . '>',
241 '</a>'
242 );
243
244 $url_params = $_GET; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
245 array_walk_recursive(
246 $url_params,
247 function ( &$val ) {
248 $val = esc_attr( $val );
249 }
250 );
251
252 return array(
253 'dismiss_notice_nonce' => wp_create_nonce( 'hustle_dismiss_notification' ),
254 'urlParams' => $url_params,
255 'module_page' => array(
256 'popup' => Hustle_Data::POPUP_LISTING_PAGE,
257 'slidein' => Hustle_Data::SLIDEIN_LISTING_PAGE,
258 'embedded' => Hustle_Data::EMBEDDED_LISTING_PAGE,
259 'social_sharing' => Hustle_Data::SOCIAL_SHARING_LISTING_PAGE,
260 ),
261 'messages' => array(
262 /* translators: Plugin name */
263 'hustleTutorials' => esc_html( sprintf( __( '%s Tutorials', 'hustle' ), Opt_In_Utils::get_plugin_name() ) ),
264 'tutorialsRemoved' => $tutorials_removed,
265 'something_went_wrong' => esc_html__( 'Something went wrong. Please try again', 'hustle' ), // everywhere.
266 'something_went_wrong_reload' => '<label class="wpmudev-label--notice"><span>' . esc_html__( 'Something went wrong. Please reload this page and try again.', 'hustle' ) . '</span></label>', // everywhere.
267 /* translators: "Aweber" between "strong" tags */
268 'aweber_migration_success' => sprintf( esc_html__( '%s integration successfully migrated to the oAuth 2.0.', 'hustle' ), '<strong>' . esc_html__( 'Aweber', 'hustle' ) . '</strong>' ), // everywhere. views.js.
269 'integraiton_required' => '<label class="wpmudev-label--notice"><span>' . esc_html__( 'An integration is required on opt-in module.', 'hustle' ) . '</span></label>', // wizard and integrations.
270 'module_deleted' => esc_html__( 'Module successfully deleted.', 'hustle' ), // listing and dashboard.
271 'shortcode_copied' => esc_html__( 'Shortcode copied successfully.', 'hustle' ), // listing and dashboard.
272 'commons' => array(
273 'published' => esc_html__( 'Published', 'hustle' ), // dashboard and wizard.
274 'draft' => esc_html__( 'Draft', 'hustle' ), // dashboard and wizard.
275 'dismiss' => esc_html__( 'Dismiss', 'hustle' ), // everywhere, views.js.
276 ),
277 'request_error_reload_notice' => esc_html__( 'There was an issue processing your request. Please reload the page and try again.', 'hustle' ),
278 ),
279 );
280 }
281
282 /**
283 * Registers styles for the admin pages.
284 *
285 * @since 4.3.1
286 *
287 * @param string $page_slug Slug of the current page.
288 */
289 public function register_styles( $page_slug ) {
290 wp_enqueue_style( 'thickbox' );
291
292 wp_register_style(
293 'hstl-roboto',
294 'https://fonts.bunny.net/css?family=Roboto+Condensed:300,300i,400,400i,700,700i|Roboto:300,300i,400,400i,500,500i,700,700i',
295 array(),
296 Opt_In::VERSION
297 );
298 wp_register_style(
299 'hstl-opensans',
300 'https://fonts.bunny.net/css?family=Open+Sans:400,400i,700,700i',
301 array(),
302 Opt_In::VERSION
303 );
304 wp_register_style(
305 'hstl-source',
306 'https://fonts.bunny.net/css?family=Source+Code+Pro',
307 array(),
308 Opt_In::VERSION
309 );
310
311 wp_enqueue_style( 'wp-color-picker' );
312 wp_enqueue_style( 'wdev_ui' );
313 wp_enqueue_style( 'wdev_notice' );
314 wp_enqueue_style( 'hstl-roboto' );
315 wp_enqueue_style( 'hstl-opensans' );
316 wp_enqueue_style( 'hstl-source' );
317
318 wp_enqueue_style(
319 'sui_styles',
320 Opt_In::$plugin_url . 'assets/css/shared-ui.min.css',
321 array(),
322 HUSTLE_SUI_VERSION
323 );
324 }
325
326 /**
327 * Adds a class to the page body with the SUI version.
328 *
329 * @since 4.3.1
330 *
331 * @param string $classes Current set of classes to be added.
332 * @return string
333 */
334 public function add_admin_body_class( $classes ) {
335 $formatted_version = str_replace( '.', '-', HUSTLE_SUI_VERSION );
336
337 $classes .= ' sui-' . $formatted_version;
338
339 /**
340 * Add high contrast mode.
341 */
342 $accessibility = Hustle_Settings_Admin::get_hustle_settings( 'accessibility' );
343 $is_high_contrast_mode = ! empty( $accessibility['accessibility_color'] );
344 if ( $is_high_contrast_mode ) {
345 $classes .= ' sui-elements-accessible';
346 }
347
348 return $classes;
349 }
350
351 /**
352 * Remove Get parameters for Hustle notices
353 *
354 * @since 4.3.1
355 *
356 * @param string[] $vars An array of query variables to remove from a URL.
357 * @return array
358 */
359 public function remove_notice_params( $vars ) {
360 $vars[] = 'show-notice';
361 $vars[] = 'notice';
362 $vars[] = 'notice-close';
363
364 return $vars;
365 }
366
367 /**
368 * Exports a single module.
369 * Used by Dashboard and Listing.
370 *
371 * @since 4.0.0
372 * @since 4.2.0 Moved from Hustle_Modules_Common_Admin to this class.
373 */
374 protected function export_module() {
375
376 $nonce = filter_input( INPUT_POST, '_wpnonce', FILTER_SANITIZE_SPECIAL_CHARS );
377 if ( ! wp_verify_nonce( $nonce, 'hustle_module_export' ) ) {
378 return;
379 }
380 $id = filter_input( INPUT_POST, 'id', FILTER_VALIDATE_INT );
381 if ( ! $id ) {
382 return;
383 }
384 // Plugin data.
385 $plugin = get_plugin_data( WP_PLUGIN_DIR . '/' . Opt_In::$plugin_base_file );
386
387 // Get module.
388 $module = new Hustle_Module_Model( $id );
389 if ( is_wp_error( $module ) ) {
390 return;
391 }
392
393 // Export data.
394 $settings = array(
395 'plugin' => array(
396 'name' => $plugin['Name'],
397 'version' => Opt_In::VERSION,
398 'network' => $plugin['Network'],
399 ),
400 'timestamp' => time(),
401 'attributes' => $module->get_attributes(),
402 'data' => $module->get_data(),
403 'meta' => array(),
404 );
405
406 if ( 'optin' === $module->module_mode ) {
407 $integrations = array();
408 $providers = Hustle_Providers::get_instance()->get_providers();
409 foreach ( $providers as $slug => $provider ) {
410 $provider_data = $module->get_provider_settings( $slug, false );
411 if ( $provider_data && $provider->is_connected()
412 && $provider->is_form_connected( $id ) ) {
413 $integrations[ $slug ] = $provider_data;
414 }
415 }
416
417 $settings['meta']['integrations'] = $integrations;
418 }
419
420 $meta_names = $module->get_module_meta_names();
421 foreach ( $meta_names as $meta_key ) {
422 $settings['meta'][ $meta_key ] = json_decode( $module->get_meta( $meta_key ) );
423 }
424 /**
425 * Filename
426 */
427 $filename = sprintf(
428 'hustle-%s-%s-%s-%s.json',
429 $module->module_type,
430 gmdate( 'Ymd-his' ),
431 get_bloginfo( 'name' ),
432 $module->module_name
433 );
434 if ( ob_get_contents() ) {
435 // To prevent other plugins' errors fail the export.
436 ob_clean();
437 }
438 $filename = strtolower( $filename );
439 $filename = sanitize_file_name( $filename );
440 /**
441 * Print HTTP headers
442 */
443 header( 'Content-Description: File Transfer' );
444 header( 'Content-Disposition: attachment; filename=' . $filename );
445 header( 'Content-Type: application/bin; charset=' . get_option( 'blog_charset' ), true );
446 /**
447 * Check PHP version, for PHP < 3 do not add options
448 */
449 $version = phpversion();
450 $compare = version_compare( $version, '5.3', '<' );
451 if ( $compare ) {
452 echo wp_json_encode( $settings );
453 exit;
454 }
455 $option = defined( 'JSON_PRETTY_PRINT' ) ? JSON_PRETTY_PRINT : null;
456 echo wp_json_encode( $settings, $option );
457 exit;
458 }
459
460 /**
461 * Filter related to TinyMCE
462 * Used by Settings and Wizard pages.
463 *
464 * @since 4.2.0 Moved from Hustle_Module_Admin to this class.
465 */
466 protected function set_up_tinymce() {
467
468 add_filter( 'tiny_mce_before_init', array( $this, 'set_tinymce_settings' ), 10, 2 );
469 add_filter( 'wp_default_editor', array( $this, 'set_editor_to_tinymce' ) );
470 add_filter( 'tiny_mce_plugins', array( $this, 'remove_despised_editor_plugins' ) );
471 add_filter( 'mce_buttons', array( $this, 'remove_readmore_tag' ) );
472 }
473
474 /**
475 * Modify tinymce editor settings.
476 *
477 * @param array $settings Registered settings.
478 * @param string $editor_id Current editor ID.
479 */
480 public function set_tinymce_settings( $settings, $editor_id ) {
481 $settings['paste_as_text'] = 'true';
482
483 return $settings;
484 }
485
486 /**
487 * Sets default editor to tinymce for opt-in admin
488 *
489 * @param string $editor_type Current editor type.
490 * @return string
491 */
492 public function set_editor_to_tinymce( $editor_type ) {
493 return 'tinymce';
494 }
495
496 /**
497 * Removes unnecessary editor plugins
498 *
499 * @param array $plugins Registered plugins.
500 * @return mixed
501 */
502 public function remove_despised_editor_plugins( $plugins ) {
503 $k = array_search( 'fullscreen', $plugins, true );
504 if ( false !== $k ) {
505 unset( $plugins[ $k ] );
506 }
507 $plugins[] = 'paste';
508 return $plugins;
509 }
510
511 /**
512 * Removes the "Read more" tag from the editor.
513 *
514 * @param array $mce_buttons Array of TinyMCE buttons.
515 * @return array
516 */
517 public function remove_readmore_tag( $mce_buttons ) {
518 $remove = array( 'wp_more' );
519 return array_diff( $mce_buttons, $remove );
520 }
521
522 /**
523 * Gets the current tab the page is on load.
524 * Used by wizards and the global settings page.
525 *
526 * @since 4.3.1
527 *
528 * @param boolean|string $default Default value.
529 * @return boolean|string
530 */
531 protected function get_current_section( $default = false ) {
532 $section = filter_input( INPUT_GET, 'section', FILTER_SANITIZE_SPECIAL_CHARS );
533 return empty( $section ) ? $default : $section;
534 }
535
536 /**
537 * SUI summary config.
538 *
539 * @since 4.2.0
540 *
541 * @param string|null $class Class to be added.
542 */
543 protected function get_sui_summary_config( $class = null ) {
544 $style = '';
545 $image_url = apply_filters( 'wpmudev_branding_hero_image', null );
546 if ( ! empty( $image_url ) ) {
547 $style = 'background-image:url(' . esc_url( $image_url ) . ')';
548 }
549 $sui = array(
550 'summary' => array(
551 'style' => $style,
552 'classes' => array(
553 'sui-box',
554 'sui-summary',
555 ),
556 ),
557 );
558 if ( ! empty( $class ) && is_string( $class ) ) {
559 $sui['summary']['classes'][] = $class;
560 }
561 /**
562 * Dash integration
563 *
564 * @since 4.0.0
565 */
566 $hide_branding = apply_filters( 'wpmudev_branding_hide_branding', false );
567 $branding_image = apply_filters( 'wpmudev_branding_hero_image', null );
568 if ( $hide_branding && ! empty( $branding_image ) ) {
569 $sui['summary']['classes'][] = 'sui-rebranded';
570 } elseif ( $hide_branding && empty( $branding_image ) ) {
571 $sui['summary']['classes'][] = 'sui-unbranded';
572 }
573 return $sui;
574 }
575
576 /**
577 * Gets the SUI classes according to the selected setitngs in WPMU Dev dashboard.
578 *
579 * @since 4.3.1
580 *
581 * @return string
582 */
583 protected function get_sui_wrap_class() {
584 $classes = array( 'sui-wrap', 'sui-wrap-hustle' );
585
586 /**
587 * Add high contrast mode.
588 */
589 $accessibility = Hustle_Settings_Admin::get_hustle_settings( 'accessibility' );
590 $is_high_contrast_mode = ! empty( $accessibility['accessibility_color'] );
591 if ( $is_high_contrast_mode ) {
592 $classes[] = 'sui-color-accessible';
593 }
594
595 /**
596 * Set hide branding.
597 *
598 * @since 4.0.0
599 */
600 $hide_branding = apply_filters( 'wpmudev_branding_hide_branding', false );
601 if ( $hide_branding ) {
602 $classes[] = 'no-hustle';
603 }
604 /**
605 * Hero image.
606 *
607 * @since 4.0.0
608 */
609 $image = apply_filters( 'wpmudev_branding_hero_image', 'hustle-default' );
610 if ( empty( $image ) ) {
611 $classes[] = 'no-hustle-hero';
612 }
613
614 $classes = apply_filters( 'hustle_sui_wrap_class', $classes );
615
616 return implode( ' ', $classes );
617 }
618
619 /**
620 * Renders the modals.
621 * This abstract class renders the modals that are displayed on all hustle's pages.
622 * Each page should override this method to add the specific modals for it.
623 *
624 * @since 4.3.5
625 */
626 protected function render_modals() {}
627
628 /**
629 * Add wp color picker
630 */
631 protected static function add_color_picker() {
632 // Deregister other similar pickers if they load from other plugins or theme.
633 wp_deregister_script( 'wp-color-picker-alpha' );
634
635 wp_register_script( 'wp-color-picker-alpha', Opt_In::$plugin_url . 'assets/js/vendor/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), '3.0.2', true );
636
637 $color_picker_strings = array(
638 'clear' => esc_html__( 'Clear', 'hustle' ),
639 'clearAriaLabel' => esc_html__( 'Clear color', 'hustle' ),
640 'defaultString' => esc_html__( 'Default', 'hustle' ),
641 'defaultAriaLabel' => esc_html__( 'Select default color', 'hustle' ),
642 'pick' => esc_html__( 'Select Color', 'hustle' ),
643 'defaultLabel' => esc_html__( 'Color value', 'hustle' ),
644 );
645 wp_localize_script( 'wp-color-picker-alpha', 'wpColorPickerL10n', $color_picker_strings );
646 wp_enqueue_script( 'wp-color-picker-alpha' );
647 }
648 }
649
650 endif;
651