Skip to content

Commit

Permalink
WPCIVIUX-126 Refactor and fix implied variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
agileware-justin committed Feb 2, 2023
1 parent f8867de commit e3ea60e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/class-civicrm-ux-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ public function enqueue_scripts() {

wp_enqueue_script( $this->civicrm_ux, plugin_dir_url( __FILE__ ) . 'js/civicrm-ux-public.js', [ 'jquery' ], $this->version, FALSE );

$opt = Civicrm_Ux::getInstance()
$opt_contribution_ux = Civicrm_Ux::getInstance()
->get_store()
->get_option( 'civicrm_contribution_ux' );

$options_map = [
'is_recur_default' => ! ! $opt['is_recur_default'],
'is_autorenew_default' => ! ! $opt['is_autorenew_default'],
'is_recur_default' => isset($opt_contribution_ux['is_recur_default']) ? true : false,
'is_autorenew_default' => isset($opt_contribution_ux['is_autorenew_default']) ? true : false,
];

wp_add_inline_script( $this->civicrm_ux, 'window.wp = window.wp || ({}); window.wp.CiviCRM_UX = (' . json_encode( $options_map ) . ')', 'before' );
Expand Down

0 comments on commit e3ea60e

Please sign in to comment.