Changeset 3198074
- Timestamp:
- 11/27/2024 11:01:14 AM (15 months ago)
- Location:
- diller-loyalty/trunk
- Files:
-
- 11 edited
-
README.txt (modified) (2 diffs)
-
assets/css/diller-loyalty-bundle-public.css (modified) (2 diffs)
-
diller-loyalty.php (modified) (4 diffs)
-
includes/class-diller-loyalty-woocommerce.php (modified) (1 diff)
-
includes/class-diller-loyalty.php (modified) (2 diffs)
-
includes/forms/class-diller-enrollment-form.php (modified) (1 diff)
-
includes/forms/class-diller-form.php (modified) (1 diff)
-
includes/forms/class-diller-wc-enrollment-form.php (modified) (1 diff)
-
includes/shortcodes/class-diller-enrollment-form-shortcode.php (modified) (1 diff)
-
includes/shortcodes/class-diller-refer-friend-shortcode.php (modified) (1 diff)
-
public/class-diller-loyalty-public.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
diller-loyalty/trunk/README.txt
r3181696 r3198074 4 4 Requires at least: 4.7 5 5 Tested up to: 6.6.0 6 Version: 2.4. 57 Stable tag: 2.4. 56 Version: 2.4.6 7 Stable tag: 2.4.6 8 8 Requires PHP: 7.3 9 9 WC requires at least: 3.8.0 … … 63 63 64 64 == Changelog == 65 = 2.4.6 = 66 * Resolves issue with inline scripts rendering between block-based and standard themes. 67 65 68 = 2.4.5 = 66 69 * Resolve incorrect WP_User/Diller Member association on order completion via REST API, when called by an external automation process. -
diller-loyalty/trunk/assets/css/diller-loyalty-bundle-public.css
r3121966 r3198074 660 660 /* FORMS */ 661 661 /*============================================================================================*/ 662 .diller-form input[type=tel] { 663 width: calc(100% - 10px - 10px); 664 } 665 .diller-form .iti > input[type=tel] { 666 width: 100%; 667 } 662 668 .diller-form input[type=text], 663 669 .diller-form input[type=email], … … 666 672 .diller-form input[type=number], 667 673 .diller-form input[type=tel], 668 .diller-form input[type=date],669 .diller-form input[type=month],670 .diller-form input[type=week],671 .diller-form input[type=time],672 .diller-form input[type=datetime],673 .diller-form input[type=datetime-local],674 .diller-form input[type=color],675 .diller-form textarea {676 width: 100%;677 }678 .diller-form input[type=text],679 .diller-form input[type=email],680 .diller-form input[type=url],681 .diller-form input[type=password],682 .diller-form input[type=number],683 674 .diller-form select { 684 675 padding: 10px; -
diller-loyalty/trunk/diller-loyalty.php
r3181696 r3198074 6 6 * Plugin URI: https://diller.no/ 7 7 * Description: Diller is a loyalty platform for businesses that is easy, affordable and profitable and integrates seamlessly with your WooCommerce shop. 8 * Version: 2.4. 58 * Version: 2.4.6 9 9 * Author: Diller AS 10 10 * Author URI: https://diller.no/kontakt/ … … 13 13 * Text Domain: diller-loyalty 14 14 * Domain Path: /languages 15 * Stable tag: 2.4. 515 * Stable tag: 2.4.6 16 16 * Requires at least: 4.7 17 17 * Tested up to: 6.6.2 … … 31 31 // Start at version 2.0.0 and use SemVer - https://semver.org 32 32 if ( ! defined( 'DILLER_LOYALTY_VERSION' ) ) { 33 define('DILLER_LOYALTY_VERSION', '2.4. 5');33 define('DILLER_LOYALTY_VERSION', '2.4.6'); 34 34 } 35 35 … … 86 86 } 87 87 88 if ( ! defined( 'DILLER_LOYALTY_JS_BUNDLE_PUBLIC_HANDLE' ) ) { 89 define( 'DILLER_LOYALTY_JS_BUNDLE_PUBLIC_HANDLE', 'diller-loyalty-public-bundle'); 90 } 91 92 if ( ! defined( 'DILLER_LOYALTY_INLINE_SCRIPTS_HANDLE' ) ) { 93 define( 'DILLER_LOYALTY_INLINE_SCRIPTS_HANDLE', 'diller-loyalty-inline-scripts'); 94 } 88 95 89 96 // Load plugin Activation/Deactivation code only for admin -
diller-loyalty/trunk/includes/class-diller-loyalty-woocommerce.php
r3181696 r3198074 751 751 $js_params->form->validationRulesTexts->phonenumber = esc_html__("You must enter a valid mobile number", "diller-loyalty"); 752 752 753 wp_add_inline_script(DILLER_LOYALTY_JS_VENDORS_BUNDLE_HANDLE, "window.Diller_Loyalty = Object.assign({}, window.Diller_Loyalty, " . json_encode($js_params) .");", 'before' ); 753 754 // For classic themes (e.g. Twenty Twenty-One) 755 if(!wp_is_block_theme()){ 756 wp_add_inline_script(DILLER_LOYALTY_JS_VENDORS_BUNDLE_HANDLE, "window.Diller_Loyalty = Object.assign({}, window.Diller_Loyalty, " . json_encode($js_params) .");", 'before' ); 757 return $fields; 758 } 759 760 // For "Full-site-editing (FSE) / Block" theme (e.g. Twenty Twenty-Two, Twenty Twenty-Four, etc) 761 wp_register_script( DILLER_LOYALTY_INLINE_SCRIPTS_HANDLE, false ); 762 wp_enqueue_script( DILLER_LOYALTY_INLINE_SCRIPTS_HANDLE, false, array(DILLER_LOYALTY_JS_BUNDLE_PUBLIC_HANDLE) ); 763 wp_add_inline_script(DILLER_LOYALTY_INLINE_SCRIPTS_HANDLE, "window.Diller_Loyalty = Object.assign({}, window.Diller_Loyalty, " . json_encode($js_params) .");", 'before' ); 754 764 755 765 return $fields; -
diller-loyalty/trunk/includes/class-diller-loyalty.php
r3181696 r3198074 610 610 611 611 /** 612 * Register all ofthe shortcodes related to the public-facing functionality612 * Register all the shortcodes related to the public-facing functionality 613 613 * of the plugin. 614 614 * … … 626 626 } 627 627 628 foreach ($short_code_forms as $ index => $sc_form){628 foreach ($short_code_forms as $sc_form){ 629 629 $this->loader->register_shortcode( $sc_form->short_code_name, $sc_form, 'render' ); 630 630 631 // Enqueues scripts and styles. 632 $this->loader->add_action( 'wp_enqueue_scripts', $sc_form, 'enqueue_styles'); 633 $this->loader->add_action( 'wp_enqueue_scripts', $sc_form, 'enqueue_scripts'); 634 } 635 } 636 637 638 /** 639 * Register all of the hooks related to the public-facing functionality 631 // Enqueue scripts and styles based on the type of the theme 632 // Ref: https://core.trac.wordpress.org/ticket/54958#comment:9 633 if(wp_is_block_theme()){ 634 // "Full-site-editing (FSE) / Block" theme (e.g. Twenty Twenty-Two, Twenty Twenty-Four, etc) 635 add_action('wp_enqueue_scripts', function() use ($sc_form){ 636 $sc_form->enqueue_scripts(); 637 $sc_form->enqueue_styles(); 638 }); 639 } 640 else{ 641 // Enqueues scripts and styles for Classic themes 642 $this->loader->add_action( 'wp_enqueue_scripts', $sc_form, 'enqueue_styles'); 643 $this->loader->add_action( 'wp_enqueue_scripts', $sc_form, 'enqueue_scripts'); 644 } 645 } 646 } 647 648 649 /** 650 * Register all the hooks related to the public-facing functionality 640 651 * of the plugin. 641 652 * -
diller-loyalty/trunk/includes/forms/class-diller-enrollment-form.php
r3121966 r3198074 525 525 } 526 526 527 528 // Implements the abstract function from the trait, by calling529 public function get_inline_javascript_params() {530 return parent::get_inline_javascript_params();531 }532 533 527 /** 534 528 * Checks for values passed in via query string that match 1 or more segments -
diller-loyalty/trunk/includes/forms/class-diller-form.php
r3043067 r3198074 135 135 136 136 if(sizeof($this->inline_scripts) > 0){ 137 // Handle arg. defines where will the inline scripts be placed 138 //wp_register_script( 'diller-loyalty-scripts', false ); 139 //wp_enqueue_script( 'diller-loyalty-scripts' ); 140 wp_add_inline_script(DILLER_LOYALTY_JS_VENDORS_BUNDLE_HANDLE, join(PHP_EOL, $this->inline_scripts), 'before' ); 137 138 // For classic themes (e.g. Twenty Twenty-One) 139 if(!wp_is_block_theme()){ 140 wp_add_inline_script(DILLER_LOYALTY_JS_BUNDLE_PUBLIC_HANDLE, join(PHP_EOL, $this->inline_scripts), 'before' ); 141 return; 142 } 143 144 // For "Full-site-editing (FSE) / Block" theme (e.g. Twenty Twenty-Two, Twenty Twenty-Four, etc) 145 wp_register_script( DILLER_LOYALTY_INLINE_SCRIPTS_HANDLE, false ); 146 wp_enqueue_script( DILLER_LOYALTY_INLINE_SCRIPTS_HANDLE, false, array(DILLER_LOYALTY_JS_BUNDLE_PUBLIC_HANDLE) ); 147 wp_add_inline_script(DILLER_LOYALTY_INLINE_SCRIPTS_HANDLE, join(PHP_EOL, $this->inline_scripts), 'before' ); 141 148 } 142 149 } -
diller-loyalty/trunk/includes/forms/class-diller-wc-enrollment-form.php
r3043067 r3198074 189 189 $this->inline_scripts[] = "window.Diller_Loyalty.modal = " . json_encode($modal_params) .";"; 190 190 } 191 192 193 // Overrides the parents function194 public function get_inline_javascript_params() {195 return parent::get_inline_javascript_params();196 }197 191 } -
diller-loyalty/trunk/includes/shortcodes/class-diller-enrollment-form-shortcode.php
r3043067 r3198074 36 36 37 37 if ($this->form->was_submitted() && $this->form->request_validated() && $this->form->save()) { 38 DillerLoyalty()->display_notices( $this->form->get_id(), false ); 39 return; 38 return DillerLoyalty()->display_notices( $this->form->get_id(), true ); 40 39 } 40 41 // Use ob_start() to Control Output Timing and preventing from printing the content too early 42 ob_start(); 41 43 $this->form->render(); 44 return ob_get_clean(); 42 45 43 46 endif; -
diller-loyalty/trunk/includes/shortcodes/class-diller-refer-friend-shortcode.php
r3043067 r3198074 19 19 $this->form->build_fields(); 20 20 21 if ($this->form->was_submitted() && $this->form->request_validated()): 22 $this->form->save() 23 ? DillerLoyalty()->display_notices($this->form->get_id(), false) 24 : $this->form->render(); 25 else: 26 $this->form->render(); 21 if ($this->form->was_submitted() && $this->form->request_validated() && $this->form->save()): 22 return DillerLoyalty()->display_notices($this->form->get_id(), false); 27 23 endif; 24 25 // Use ob_start() to Control Output Timing and preventing from printing the content too early 26 ob_start(); 27 $this->form->render(); 28 return ob_get_clean(); 28 29 } 29 30 -
diller-loyalty/trunk/public/class-diller-loyalty-public.php
r2698466 r3198074 59 59 // Enqueues all the necessary 3rd party scripts bundles into a single file. This matches all the dependency files added via npm command 60 60 wp_enqueue_script( DILLER_LOYALTY_JS_VENDORS_BUNDLE_HANDLE, trailingslashit( DILLER_LOYALTY_URL ) . 'assets/js/vendors-bundle.js', array( 'jquery' ), DillerLoyalty()->get_version("assets"), true ); 61 wp_enqueue_script( 'diller-loyalty-public-bundle', trailingslashit( DILLER_LOYALTY_URL ) . 'assets/js/diller-loyalty-public-bundle.js', array( DILLER_LOYALTY_JS_VENDORS_BUNDLE_HANDLE), DillerLoyalty()->get_version("assets"), true );61 wp_enqueue_script( DILLER_LOYALTY_JS_BUNDLE_PUBLIC_HANDLE, trailingslashit( DILLER_LOYALTY_URL ) . 'assets/js/diller-loyalty-public-bundle.js', array( DILLER_LOYALTY_JS_VENDORS_BUNDLE_HANDLE), DillerLoyalty()->get_version("assets"), true ); 62 62 } 63 63
Note: See TracChangeset
for help on using the changeset viewer.