Changeset 3453503
- Timestamp:
- 02/04/2026 06:10:38 AM (2 weeks ago)
- Location:
- woo-checkout-field-editor-pro/trunk
- Files:
-
- 24 edited
-
admin/class-thwcfd-admin-form-block-field.php (modified) (2 diffs)
-
admin/class-thwcfd-admin-form.php (modified) (4 diffs)
-
admin/class-thwcfd-admin-settings-advanced.php (modified) (2 diffs)
-
admin/class-thwcfd-admin-settings-block-fields.php (modified) (5 diffs)
-
admin/class-thwcfd-admin-settings-general.php (modified) (4 diffs)
-
admin/class-thwcfd-admin-settings-pro.php (modified) (2 diffs)
-
admin/class-thwcfd-admin-settings-themehigh-plugins.php (modified) (3 diffs)
-
admin/class-thwcfd-admin-settings.php (modified) (2 diffs)
-
admin/class-thwcfd-admin.php (modified) (7 diffs)
-
admin/thwcfd-landing-page.php (modified) (12 diffs)
-
block/assets/dist/style-additional-sections-frontend-rtl.css (modified) (1 diff)
-
block/assets/dist/style-additional-sections-frontend.css (modified) (1 diff)
-
block/assets/dist/style-contact-info-section-frontend-rtl.css (modified) (1 diff)
-
block/assets/dist/style-contact-info-section-frontend.css (modified) (1 diff)
-
block/class-thwcfd-block-order-data.php (modified) (3 diffs)
-
block/class-thwcfd-block.php (modified) (9 diffs)
-
changelog.txt (modified) (1 diff)
-
checkout-form-designer.php (modified) (2 diffs)
-
includes/class-thwcfd.php (modified) (3 diffs)
-
includes/utils/class-thwcfd-utils-block.php (modified) (3 diffs)
-
includes/utils/class-thwcfd-utils.php (modified) (6 diffs)
-
languages/woo-checkout-field-editor-pro.pot (modified) (14 diffs)
-
public/class-thwcfd-public-checkout.php (modified) (16 diffs)
-
readme.txt (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-form-block-field.php
r3370969 r3453503 380 380 private function render_form_field_checkbox( $section = '' ){ 381 381 $value_props = $this->field_props['value']; 382 $value_props['label'] = __('Value', 'woo commerce');382 $value_props['label'] = __('Value', 'woo-checkout-field-editor-pro'); 383 383 384 384 ?> … … 469 469 ?> 470 470 <tr> 471 <td class="sub-title"><?php esc_html_e('Options', 'woo commerce'); ?></td>471 <td class="sub-title"><?php esc_html_e('Options', 'woo-checkout-field-editor-pro'); ?></td> 472 472 <?php $this->render_form_fragment_tooltip(); ?> 473 473 <td></td> -
woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-form.php
r3221414 r3453503 205 205 foreach($field['options'] as $value => $label){ 206 206 $selected = $value === $fvalue ? 'selected' : ''; 207 $field_html .= '<option value="'. esc_attr(trim($value)) .'" '.esc_attr($selected).'>'. esc_html__($label, 'woo-checkout-field-editor-pro') .'</option>'; 207 $label = THWCFD_Utils::translate_dynamic_text($label, 'option'); 208 $field_html .= '<option value="'. esc_attr(trim($value)) .'" '.esc_attr($selected).'>'. esc_html($label) .'</option>'; 208 209 } 209 210 $field_html .= '</select>'; … … 229 230 foreach($field['options'] as $value => $label){ 230 231 //$selected = $value === $fvalue ? 'selected' : ''; 231 $field_html .= '<option value="'. esc_attr(trim($value)) .'" >'. esc_html__($label, 'woo-checkout-field-editor-pro') .'</option>'; 232 $label = THWCFD_Utils::translate_dynamic_text($label, 'option'); 233 $field_html .= '<option value="'. esc_attr(trim($value)) .'" >'. esc_html($label) .'</option>'; 232 234 } 233 235 $field_html .= '</select>'; … … 250 252 $value = $value.$field['glue'].trim($label); 251 253 } 252 253 $field_html .= '<option value="'. esc_attr($value) .'">'. esc_html __($label, 'woo-checkout-field-editor-pro') .'</option>';254 $label = THWCFD_Utils::translate_dynamic_text($label, 'option'); 255 $field_html .= '<option value="'. esc_attr($value) .'">'. esc_html($label) .'</option>'; 254 256 } 255 257 … … 289 291 290 292 $fid = $args['id_prefix']. $field['name']; 291 $flabel = isset($field['label']) && !empty($field['label']) ? __($field['label'], 'woo-checkout-field-editor-pro') : '';293 $flabel = isset($field['label']) && !empty($field['label']) ? THWCFD_Utils::translate_dynamic_text($field['label'], 'label') : ''; 292 294 293 295 $field_props = $this->prepare_form_field_props($field, $atts); -
woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings-advanced.php
r3188388 r3453503 218 218 219 219 $imp_exp_fields = array( 220 'section_import_export' => array('title'=>__('Backup and Import Settings', 'woo-checkout-field-editor '), 'type'=>'separator', 'colspan'=>'3'),220 'section_import_export' => array('title'=>__('Backup and Import Settings', 'woo-checkout-field-editor-pro'), 'type'=>'separator', 'colspan'=>'3'), 221 221 'settings_data' => array( 222 'name'=>'settings_data', 'label'=>__('Plugin Settings Data', 'woo-checkout-field-editor '), 'type'=>'textarea', 'value' => $plugin_settings,223 'sub_label'=>__('You can transfer the saved settings data between different installs by copying the text inside the text box. To import data from another install, replace the data in the text box with the one from another install and click "Import Settings".', 'woo-checkout-field-editor '),222 'name'=>'settings_data', 'label'=>__('Plugin Settings Data', 'woo-checkout-field-editor-pro'), 'type'=>'textarea', 'value' => $plugin_settings, 223 'sub_label'=>__('You can transfer the saved settings data between different installs by copying the text inside the text box. To import data from another install, replace the data in the text box with the one from another install and click "Import Settings".', 'woo-checkout-field-editor-pro'), 224 224 ), 225 225 ); … … 238 238 <td colspan="2"> </td> 239 239 <td class="submit"> 240 <input type="submit" name="save_plugin_settings" class="btn btn-small btn-primary" value="<?php esc_attr_e('Import Settings', 'woo-checkout-field-editor '); ?>">240 <input type="submit" name="save_plugin_settings" class="btn btn-small btn-primary" value="<?php esc_attr_e('Import Settings', 'woo-checkout-field-editor-pro'); ?>"> 241 241 <?php wp_nonce_field( 'import_wcfd_settings', 'import_wcfd_nonce' ); ?> 242 242 </td> -
woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings-block-fields.php
r3370969 r3453503 184 184 185 185 if(isset($property['status']) && $property['status'] == 1){ 186 $statusHtml = $pvalue == 1 ? '<span class="dashicons dashicons-yes tips" data-tip="'. esc_attr(__('Yes', 'woo commerce')).'"></span>' : '-';186 $statusHtml = $pvalue == 1 ? '<span class="dashicons dashicons-yes tips" data-tip="'. esc_attr(__('Yes', 'woo-checkout-field-editor-pro')).'"></span>' : '-'; 187 187 ?> 188 188 <td class="td_<?php echo esc_attr($pname); ?> status"><?php echo wp_kses($statusHtml, array('span' => array('class' => true))); ?></td> … … 319 319 if(THWCFD_Utils_Section::is_valid_section($section)){ 320 320 $f_names = !empty( $_POST['f_name'] ) ? $_POST['f_name'] : array(); 321 $f_names = array_map('sanitize_key', $f_names); 321 322 if(empty($f_names)){ 322 323 echo '<div class="error"><p> '. esc_html__('Your changes were not saved due to no fields found.', 'woo-checkout-field-editor-pro') .'</p></div>'; … … 325 326 326 327 $f_order = !empty( $_POST['f_order'] ) ? $_POST['f_order'] : array(); 328 $f_order = array_map('absint', $f_order); 327 329 $f_deleted = !empty( $_POST['f_deleted'] ) ? $_POST['f_deleted'] : array(); 328 $f_enabled = !empty( $_POST['f_enabled'] ) ? $_POST['f_enabled'] : array(); 330 $f_deleted = array_map('absint', $f_deleted); 331 $f_enabled = !empty( $_POST['f_enabled'] ) ? $_POST['f_enabled'] : array(); 332 $f_enabled = array_map('absint', $f_enabled); 329 333 $sname = $section->get_property('name'); 330 334 $field_set = THWCFD_Utils_Section::get_fields($section); … … 515 519 $c_url = $this->get_admin_url($this->page_id, 'classic'); 516 520 $b_url = $this->get_admin_url($this->page_id, 'block'); 517 $tt_content = esc_html("You're on the Classic Checkout Field Editor right now. If your store is not using Classic Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo commerce-checkout-field-editor-pro');518 if ( !empty( $_GET['c_type'] ) && 'block' == $_GET['c_type']) {519 $tt_content = esc_html("You're on the Block Checkout Field Editor right now. If your store is not using Block Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo commerce-checkout-field-editor-pro');521 $tt_content = esc_html("You're on the Classic Checkout Field Editor right now. If your store is not using Classic Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo-checkout-field-editor-pro'); 522 if ( !empty( $_GET['c_type'] ) && 'block' == sanitize_key($_GET['c_type'] )) { 523 $tt_content = esc_html("You're on the Block Checkout Field Editor right now. If your store is not using Block Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo-checkout-field-editor-pro'); 520 524 } 521 525 ?> … … 555 559 556 560 $result = false; 557 $s_action = isset($_POST['s_action']) ? $_POST['s_action']: false;561 $s_action = isset($_POST['s_action']) ? sanitize_text_field(wp_unslash($_POST['s_action'])) : false; 558 562 559 563 if($s_action == 'edit'){ -
woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings-general.php
r3370969 r3453503 153 153 $label = isset($field['label']) ? $field['label'] : ''; 154 154 $placeholder = isset($field['placeholder']) ? $field['placeholder'] : ''; 155 $label = THWCFD_Utils::translate_dynamic_text($label, 'label'); 156 $placeholder = THWCFD_Utils::translate_dynamic_text($placeholder, 'placeholder'); 155 157 $validate = isset($field['validate']) ? $field['validate'] : ''; 156 158 $required = isset($field['required']) && $field['required'] ? 1 : 0; … … 185 187 <td class="td_name"><?php echo esc_html( $name ); ?></td> 186 188 <td class="td_type"><?php echo esc_html($type); ?></td> 187 <td class="td_label"><?php echo esc_html_e($label, 'woo-checkout-field-editor-pro'); ?></td> 188 <td class="td_placeholder"><?php echo esc_html_e($placeholder, 'woo-checkout-field-editor-pro'); ?></td> 189 <?php /* 190 // The following lines were removed because they violate WordPress i18n rules. 191 <td class="td_placeholder"><?php echo esc_html_e($placeholder, 'woo-checkout-field-editor-pro'); ?></td> 192 <td class="td_placeholder"><?php echo esc_html_e($placeholder, 'woo-checkout-field-editor-pro'); ?></td> 193 */ ?> 194 <td class="td_label"><?php echo esc_html($label); ?></td> 195 <td class="td_placeholder"><?php echo esc_html($placeholder); ?></td> 189 196 <td class="td_validate"><?php echo esc_html($validate); ?></td> 190 197 <td class="td_required status"><?php echo wp_kses($required_status, array('span' => array('class' => true))); ?></td> … … 461 468 if(!empty($value)){ 462 469 $value = THWCFD_Utils::get_option_text($field, $value); 463 $label = isset($field['label']) && $field['label'] ? esc_html( $field['label'], 'woo-checkout-field-editor-pro') : $name;470 $label = isset($field['label']) && $field['label'] ? esc_html(THWCFD_Utils::translate_dynamic_text($field['label'], 'label')) : $name; 464 471 $html .= '<p><strong>'. esc_html($label) .':</strong><br/> '. wp_kses_post(wptexturize($value)) .'</p>'; 465 472 } … … 513 520 $c_url = $this->get_admin_url($this->page_id, 'classic'); 514 521 $b_url = $this->get_admin_url($this->page_id, 'block'); 515 $tt_content = esc_html("You're on the Classic Checkout Field Editor right now. If your store is not using Classic Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo commerce-checkout-field-editor-pro');516 if ( !empty( $_GET['c_type'] ) && 'block' == $_GET['c_type']) {517 $tt_content = esc_html("You're on the Block Checkout Field Editor right now. If your store is not using Block Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo commerce-checkout-field-editor-pro');522 $tt_content = esc_html("You're on the Classic Checkout Field Editor right now. If your store is not using Classic Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo-checkout-field-editor-pro'); 523 if ( !empty( $_GET['c_type'] ) && 'block' == sanitize_key($_GET['c_type'] )) { 524 $tt_content = esc_html("You're on the Block Checkout Field Editor right now. If your store is not using Block Checkout, fields you add here won’t appear on the checkout page. Unsure which checkout type your store is using?", 'woo-checkout-field-editor-pro'); 518 525 } 519 526 ?> -
woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings-pro.php
r3118023 r3453503 46 46 47 47 if($now > $render_time){ 48 $url = "https://www.themehigh.com/?edd_action=add_to_cart&download_id=12&cp=lyCDSy&utm_source= free&utm_medium=premium_tab&utm_campaign=wcfe_upgrade_link";48 $url = "https://www.themehigh.com/?edd_action=add_to_cart&download_id=12&cp=lyCDSy&utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_premium_tab_upgrade_link"; 49 49 }else{ 50 $url = "https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source= free&utm_medium=premium_tab&utm_campaign=wcfe_upgrade_link";50 $url = "https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_premium_tab_upgrade_link"; 51 51 } 52 52 … … 76 76 <h3 class="trydemo-heading">The Golden Perks that Come with the Checkout Field Editor Pro</h3> 77 77 <p class="try-demo-desc">The numerous advanced features that accompany the Checkout Field Editor Pro for WooCommerce plugin lets you create an organized and flawless checkout page. Why wait? Go pro and advance your checkout page to the next level now.</p> 78 <div class="th-pro-btn"><a class="btn-get-pro" onclick="this.classList.add('clicked')" href="<?php echo esc_url($url); ?>" target="_blank" rel="noopener noreferrer" >Get Pro</a><a class="btn-try-demo" href="https://flydemos.com/wcfe/?utm_source= free&utm_medium=banner&utm_campaign=trydemo"78 <div class="th-pro-btn"><a class="btn-get-pro" onclick="this.classList.add('clicked')" href="<?php echo esc_url($url); ?>" target="_blank" rel="noopener noreferrer" >Get Pro</a><a class="btn-try-demo" href="https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=premium_tab_try_demo" 79 79 target="_blank" rel="noopener noreferrer" onclick="this.classList.add('clicked')" >Try Demo</a></div> 80 80 <!-- <img class="vedio" src="" alt="no img"> ADD vedio tutorial--> -
woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings-themehigh-plugins.php
r3160299 r3453503 231 231 // The plugin is already active. 232 232 $button = array( 233 'message' => esc_attr__( 'Activated', ' storefront' ),233 'message' => esc_attr__( 'Activated', 'woo-checkout-field-editor-pro' ), 234 234 'url' => '#', 235 235 'classes' => array('button', 'disabled' ), … … 244 244 // The plugin exists but isn't activated yet. 245 245 $button = array( 246 'message' => esc_attr__( 'Activate', ' storefront' ),246 'message' => esc_attr__( 'Activate', 'woo-checkout-field-editor-pro' ), 247 247 'url' => $url, 248 248 'classes' => array( 'activate-now', 'button' ), … … 265 265 ); 266 266 $button = array( 267 'message' => esc_attr__( 'Install now', ' storefront' ),267 'message' => esc_attr__( 'Install now', 'woo-checkout-field-editor-pro' ), 268 268 'url' => $url, 269 269 'classes' => array('button-primary', 'install-now', 'install-' . $plugin_slug ), -
woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin-settings.php
r3370969 r3453503 157 157 158 158 $ftype = isset($field['type']) ? $field['type'] : 'text'; 159 $flabel = isset($field['label']) && !empty($field['label']) ? __($field['label'], 'woo-checkout-field-editor-pro'): '';160 $sub_label = isset($field['sub_label']) && !empty($field['sub_label']) ? __($field['sub_label'], 'woo-checkout-field-editor-pro'): '';161 $tooltip = isset($field['hint_text']) && !empty($field['hint_text']) ? __($field['hint_text'], 'woo-checkout-field-editor-pro'): '';159 $flabel = isset($field['label']) && !empty($field['label']) ? $field['label'] : ''; 160 $sub_label = isset($field['sub_label']) && !empty($field['sub_label']) ? $field['sub_label'] : ''; 161 $tooltip = isset($field['hint_text']) && !empty($field['hint_text']) ? $field['hint_text'] : ''; 162 162 163 163 $field_html = ''; … … 258 258 259 259 $fid = 'a_f'. $field['name']; 260 $flabel = isset($field['label']) && !empty($field['label']) ? __($field['label'], 'woo-checkout-field-editor-pro'): '';260 $flabel = isset($field['label']) && !empty($field['label']) ? $field['label'] : ''; 261 261 262 262 $field_props = $this->prepare_form_field_props($field, $atts); -
woo-checkout-field-editor-pro/trunk/admin/class-thwcfd-admin.php
r3370969 r3453503 70 70 $settings_link = '<a href="'.esc_url(admin_url('admin.php?page=checkout_form_designer')).'">'. __('Settings', 'woo-checkout-field-editor-pro') .'</a>'; 71 71 array_unshift($links, $settings_link); 72 $pro_link = '<a style="color:green; font-weight:bold" target="_blank" href="https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source= free&utm_medium=plugin_action_link&utm_campaign=wcfe_upgrade_link">'. __('Get Pro', 'woo-checkout-field-editor-pro') .'</a>';72 $pro_link = '<a style="color:green; font-weight:bold" target="_blank" href="https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_settings_upgrade_link">'. __('Get Pro', 'woo-checkout-field-editor-pro') .'</a>'; 73 73 array_push($links,$pro_link); 74 74 … … 86 86 if ( 'woo-checkout-field-editor-pro/checkout-form-designer.php' === $plugin_file ) { 87 87 $plugin_meta[] = '<a href="https://www.facebook.com/groups/themehigh/" target="_blank">' . esc_html__( 'Join Community', 'woo-checkout-field-editor-pro' ) . '</a>'; 88 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/reviews/ ?filter=5" target="_blank">' . esc_html__( 'Review us', 'woo-checkout-field-editor-pro' ) . '</a>';88 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/reviews/" target="_blank">' . esc_html__( 'Review us', 'woo-checkout-field-editor-pro' ) . '</a>'; 89 89 } 90 90 return $plugin_meta; … … 96 96 echo '<h2>'. esc_html__('Checkout Form', 'woo-checkout-field-editor-pro') .'</h2>'; 97 97 $tab = $this->get_current_tab(); 98 $c_type = isset( $_GET['c_type'] ) ? esc_attr( $_GET['c_type'] ) : 'classic';98 $c_type = isset( $_GET['c_type'] ) ? sanitize_key( $_GET['c_type'] ) : 'classic'; 99 99 100 100 echo '<div class="thwcfd-wrap">'; … … 138 138 <span class="th-warning-message-panel__inner-text"> 139 139 <?php 140 140 141 printf( 142 /* translators: %s: Support team link */ 141 143 esc_html__("Our Checkout Field Editor now supports WooCommerce Checkout Blocks! Currently, a few field types are available, and more will be added soon. 142 144 If you're using Block Checkout, make sure to switch to the Block Checkout Fields tab, otherwise, your changes won’t be reflected. Have questions or need help? 143 Reach out to our %s .", 'woo commerce-checkout-field-editor-pro'),145 Reach out to our %s .", 'woo-checkout-field-editor-pro'), 144 146 '<a href="https://www.themehigh.com/docs/support/" target="_blank" class="quick-widget-support-link">' . esc_html__(' Support team', 'woo-checkout-field-editor-pro') . '</a>' 145 147 ); … … 513 515 $dismiss_url = $admin_url . '&thwcfd_discount_popup_dismiss=true&thwcfd_discount_popup_nonce=' . wp_create_nonce( 'thwcfd_discount_popup_security'); 514 516 515 $url = "https://www.themehigh.com/?edd_action=add_to_cart&download_id=12&cp=lyCDSy&utm_source= free&utm_medium=premium_tab&utm_campaign=wcfe_upgrade_link";517 $url = "https://www.themehigh.com/?edd_action=add_to_cart&download_id=12&cp=lyCDSy&utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_premium_tab_upgrade_link"; 516 518 517 519 $current_page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash($_GET['page'])) : ''; … … 615 617 </svg> 616 618 </div> 617 <a href="https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source= free&utm_medium=quicklinks&utm_campaign=wcfe_upgrade_link" target="_blank" class="quick-widget-doc-link">Upgrade to Premium</a></li>619 <a href="https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_settings_upgrade_link" target="_blank" class="quick-widget-doc-link">Upgrade to Premium</a></li> 618 620 <li> 619 621 … … 726 728 return true; 727 729 } 730 731 public function remove_welcome_page_menu() { 732 remove_submenu_page( 'index.php', 'thwcfd-welcome' ); 733 } 728 734 } 729 735 -
woo-checkout-field-editor-pro/trunk/admin/thwcfd-landing-page.php
r3370969 r3453503 18 18 <meta name="viewport" content="width=device-width" /> 19 19 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 20 <title><?php esc_html_e( 'Checkout field editor Landing page', 'woo commerce-checkout-field-editor-pro' ); ?></title>20 <title><?php esc_html_e( 'Checkout field editor Landing page', 'woo-checkout-field-editor-pro' ); ?></title> 21 21 </head> 22 22 <body class="thwcfd-admin-page thwcfd-landing-page wp-core-ui"> … … 36 36 </div> 37 37 </div> 38 <h1 style="font-weight: 700;"><?php esc_html_e("Welcome to Checkout Field Editor!", 'woo commerce-checkout-field-editor-pro' ); ?></h1>38 <h1 style="font-weight: 700;"><?php esc_html_e("Welcome to Checkout Field Editor!", 'woo-checkout-field-editor-pro' ); ?></h1> 39 39 <p class ="th-desc-head" > 40 <?php esc_html_e( "We’re excited to have you on board! Now, you can easily customize your WooCommerce checkout using both the Block Checkout Editor and the Classic Checkout Field Editor. Enjoy complete flexibility and control! " , 'woo commerce-checkout-field-editor-pro' ); ?>40 <?php esc_html_e( "We’re excited to have you on board! Now, you can easily customize your WooCommerce checkout using both the Block Checkout Editor and the Classic Checkout Field Editor. Enjoy complete flexibility and control! " , 'woo-checkout-field-editor-pro' ); ?> 41 41 </p> 42 42 43 43 <a href="<?php echo esc_url(admin_url('admin.php?page=checkout_form_designer&tab=fields&c_type=classic')); ?>" class="th-get-started-btn"> 44 <?php esc_html_e("Get Started" , 'woo commerce-checkout-field-editor-pro' ); ?>44 <?php esc_html_e("Get Started" , 'woo-checkout-field-editor-pro' ); ?> 45 45 </a> 46 46 47 47 <div class="th-read-more"> 48 <p> <?php esc_html_e("Learn more about both editors to make the most out of your checkout", 'woo commerce-checkout-field-editor-pro' ); ?> </p>48 <p> <?php esc_html_e("Learn more about both editors to make the most out of your checkout", 'woo-checkout-field-editor-pro' ); ?> </p> 49 49 <!-- <button> 50 <?php //esc_html_e("Read More!", 'woo commerce-checkout-field-editor-pro' ); ?>50 <?php //esc_html_e("Read More!", 'woo-checkout-field-editor-pro' ); ?> 51 51 </button> --> 52 52 <a href="https://www.themehigh.com/docs/classic-vs-block-checkout/" target="_blank" rel="noopener noreferrer"> 53 53 <button type="button"> 54 <?php esc_html_e("Read More!", 'woo commerce-checkout-field-editor-pro' ); ?>54 <?php esc_html_e("Read More!", 'woo-checkout-field-editor-pro' ); ?> 55 55 </button> 56 56 </a> … … 58 58 59 59 <div class="th-sub-content" style=""> 60 <p ><?php esc_html_e("We support both Classic and Block Checkout. Choose the one you're using", 'woo commerce-checkout-field-editor-pro' ); ?></p>61 <h2><?php esc_html_e("Which Checkout Fields should you use?", 'woo commerce-checkout-field-editor-pro' ); ?> </h2>60 <p ><?php esc_html_e("We support both Classic and Block Checkout. Choose the one you're using", 'woo-checkout-field-editor-pro' ); ?></p> 61 <h2><?php esc_html_e("Which Checkout Fields should you use?", 'woo-checkout-field-editor-pro' ); ?> </h2> 62 62 63 63 <div class="th-diff-box-wrap"> … … 70 70 </svg> 71 71 <div> 72 <h3><?php esc_html_e("Classic Checkout", 'woo commerce-checkout-field-editor-pro' ); ?></h3>72 <h3><?php esc_html_e("Classic Checkout", 'woo-checkout-field-editor-pro' ); ?></h3> 73 73 <ul> 74 74 <li> … … 76 76 <use xlink:href="#bullet-icon"></use> 77 77 </svg> 78 <p><?php esc_html_e("Use this if you’re still using the traditional WooCommerce checkout page.", 'woo commerce-checkout-field-editor-pro' ); ?></p>78 <p><?php esc_html_e("Use this if you’re still using the traditional WooCommerce checkout page.", 'woo-checkout-field-editor-pro' ); ?></p> 79 79 </li> 80 80 <li> … … 82 82 <use xlink:href="#bullet-icon"></use> 83 83 </svg> 84 <p><?php esc_html_e("Compatible with older checkout layouts.", 'woo commerce-checkout-field-editor-pro' ); ?></p>84 <p><?php esc_html_e("Compatible with older checkout layouts.", 'woo-checkout-field-editor-pro' ); ?></p> 85 85 </li> 86 86 <li> … … 88 88 <use xlink:href="#bullet-icon"></use> 89 89 </svg> 90 <p><?php esc_html_e("Best for users who prefer the classic, non-block experience.", 'woo commerce-checkout-field-editor-pro' ); ?> </p>90 <p><?php esc_html_e("Best for users who prefer the classic, non-block experience.", 'woo-checkout-field-editor-pro' ); ?> </p> 91 91 </li> 92 92 </ul> … … 101 101 <div class="th-diff-box-content"> 102 102 <div> 103 <h3 style="font-weight: bold;"><?php esc_html_e("Block Checkout", 'woo commerce-checkout-field-editor-pro' ); ?></h3>103 <h3 style="font-weight: bold;"><?php esc_html_e("Block Checkout", 'woo-checkout-field-editor-pro' ); ?></h3> 104 104 <ul> 105 105 <li> … … 107 107 <use xlink:href="#bullet-icon"></use> 108 108 </svg> 109 <p> <?php esc_html_e("Use this if you’ve transitioned to WooCommerce’s new Block-based checkout.", 'woo commerce-checkout-field-editor-pro' ); ?></p>109 <p> <?php esc_html_e("Use this if you’ve transitioned to WooCommerce’s new Block-based checkout.", 'woo-checkout-field-editor-pro' ); ?></p> 110 110 </li> 111 111 <li> … … 113 113 <use xlink:href="#bullet-icon"></use> 114 114 </svg> 115 <p> <?php esc_html_e( "Easier to customize with block elements.", 'woo commerce-checkout-field-editor-pro'); ?> </p>115 <p> <?php esc_html_e( "Easier to customize with block elements.", 'woo-checkout-field-editor-pro'); ?> </p> 116 116 </li> 117 117 <li> … … 119 119 <use xlink:href="#bullet-icon"></use> 120 120 </svg> 121 <p> <?php esc_html_e("Best for users looking for a more modern, flexible checkout design",'woo commerce-checkout-field-editor-pro'); ?>.</p>121 <p> <?php esc_html_e("Best for users looking for a more modern, flexible checkout design",'woo-checkout-field-editor-pro'); ?>.</p> 122 122 </li> 123 123 </ul> … … 130 130 <div class="th-btn-box"> 131 131 <a href="<?php echo esc_url(admin_url('admin.php?page=checkout_form_designer&tab=fields&c_type=classic')); ?>" class="th-choose-btn"> 132 <?php esc_html_e('Go with Classic Checkout Editor', 'woo commerce-checkout-field-editor-pro') ?>132 <?php esc_html_e('Go with Classic Checkout Editor', 'woo-checkout-field-editor-pro') ?> 133 133 </a> 134 134 <a href="<?php echo esc_url(admin_url('admin.php?page=checkout_form_designer&tab=fields&c_type=block')); ?>" class="th-choose-btn"> 135 <?php esc_html_e('Go with Block Checkout Editor', 'woo commerce-checkout-field-editor-pro') ?>135 <?php esc_html_e('Go with Block Checkout Editor', 'woo-checkout-field-editor-pro') ?> 136 136 </a> 137 137 </div> 138 138 </div> 139 139 <a href="<?php echo esc_url(admin_url('admin.php?page=checkout_form_designer&tab=fields&c_type=classic')); ?>" class="th-get-started-btn"> 140 <?php esc_html_e("Let's Get started", 'woo commerce-checkout-field-editor-pro' ); ?>140 <?php esc_html_e("Let's Get started", 'woo-checkout-field-editor-pro' ); ?> 141 141 </a> 142 142 </div> -
woo-checkout-field-editor-pro/trunk/block/assets/dist/style-additional-sections-frontend-rtl.css
r3370969 r3453503 1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{right:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding: 0 2.5em 0 calc(16px + 1.5em)}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}.wc-block-checkout__additional-fields{margin-bottom:1.5em}.block-editor-inner-blocks .wc-blocks-components-select .wc-blocks-components-select__select{max-width:revert}1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{right:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:.5em 2.5em 0 calc(16px + 1.5em)}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}.wc-block-checkout__additional-fields{margin-bottom:1.5em}.block-editor-inner-blocks .wc-blocks-components-select .wc-blocks-components-select__select{max-width:revert}.wc-block-checkout__additional-fields__field{margin-top:10px} -
woo-checkout-field-editor-pro/trunk/block/assets/dist/style-additional-sections-frontend.css
r3370969 r3453503 1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{left:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding: 0 calc(16px + 1.5em) 0 2.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}.wc-block-checkout__additional-fields{margin-bottom:1.5em}.block-editor-inner-blocks .wc-blocks-components-select .wc-blocks-components-select__select{max-width:revert}1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{left:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:.5em calc(16px + 1.5em) 0 2.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}.wc-block-checkout__additional-fields{margin-bottom:1.5em}.block-editor-inner-blocks .wc-blocks-components-select .wc-blocks-components-select__select{max-width:revert}.wc-block-checkout__additional-fields__field{margin-top:10px} -
woo-checkout-field-editor-pro/trunk/block/assets/dist/style-contact-info-section-frontend-rtl.css
r3370969 r3453503 1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{right:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding: 02.5em 0 calc(16px + 1.5em)}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{right:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:.5em 2.5em 0 calc(16px + 1.5em)}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px} -
woo-checkout-field-editor-pro/trunk/block/assets/dist/style-contact-info-section-frontend.css
r3370969 r3453503 1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{left:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding: 0calc(16px + 1.5em) 0 2.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px}1 .wc-block-components-radio-control.thwcfe-radio-control{margin-top:10px}.wc-block-components-radio-control.thwcfe-radio-control label.wc-block-components-radio-control__option--checked-option-highlighted{box-shadow:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option:after{background:none}.wc-block-components-radio-control.thwcfe-radio-control.wc-block-components-radio-control--highlight-checked:after{border:none}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__input{left:0}.wc-block-components-radio-control.thwcfe-radio-control .wc-block-components-radio-control__option{padding:.5em calc(16px + 1.5em) 0 2.5em}.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox]:focus:required{outline:1px solid #cc1818;outline-offset:2px} -
woo-checkout-field-editor-pro/trunk/block/class-thwcfd-block-order-data.php
r3221414 r3453503 259 259 260 260 if($title){ 261 $title = __($title, 'woo-checkout-field-editor-pro'); 261 //$title = __($title, 'woo-checkout-field-editor-pro'); 262 $title = THWCFD_Utils::translate_dynamic_text($title, 'label'); 262 263 $subtitle = $section->get_property('subtitle'); 263 264 $subtitle = apply_filters('thwcfe_section_subtitle', $subtitle, $section->name, $context); 264 $subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : '';265 //$subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : ''; 265 266 266 267 if($context === self::VIEW_ADMIN_ORDER){ … … 396 397 if($title || $subtitle){ 397 398 if($esc_attr_label){ 398 $title = $title ? __($title,'woo-checkout-field-editor-pro') : '';399 $subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : '';399 $title = $title ? THWCFD_Utils::translate_dynamic_text($title, 'label') : ''; 400 //$subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : ''; 400 401 }else{ 401 $title = $title ? __($title,'woo-checkout-field-editor-pro') : '';402 $subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : '';402 $title = $title ? THWCFD_Utils::translate_dynamic_text($title, 'label') : ''; 403 //$subtitle = $subtitle ? __($subtitle,'woo-checkout-field-editor-pro') : ''; 403 404 } 404 405 … … 417 418 if(!empty($value) || (($value === '0') && apply_filters( 'thwcfe_accept_value_zero',false))){ 418 419 $title = $field->get_property('title') ? $field->get_property('title') : $name; 419 $title = $esc_attr_label ? __($title, 'woo-checkout-field-editor-pro') : __($title, 'woo-checkout-field-editor-pro');420 $title = THWCFD_Utils::translate_dynamic_text( $title, 'label' ); 420 421 421 422 if($type === 'file'){ -
woo-checkout-field-editor-pro/trunk/block/class-thwcfd-block.php
r3370969 r3453503 74 74 75 75 if (isset($field_data['label'])) { 76 $field_data['label'] = __($field_data['label'], 'woo-checkout-field-editor-pro'); 76 //$field_data['label'] = __($field_data['label'], 'woo-checkout-field-editor-pro'); 77 $field_data['label'] = THWCFD_Utils::translate_dynamic_text($field_data['label'], 'label'); 77 78 } 78 79 woocommerce_register_additional_checkout_field( … … 82 83 'optionalLabel' => $remove_optional ? $field_data['label'] : sprintf( 83 84 /* translators: %s Field label. */ 84 __( '%s (optional)', 'woocommerce' ), 85 __( '%s (optional)', 'woocommerce' ), // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch 85 86 $field_data['label'] 86 87 ), … … 103 104 $field_options = array(); 104 105 foreach ($options as $option) { 106 $option['text'] = THWCFD_Utils::translate_dynamic_text($option['text'], 'option'); 105 107 $field_options[] = array( 106 108 'label' => $option['text'], … … 171 173 } 172 174 if (isset($field_set[$key])) { 173 $field['index'] = $field_set[$key]['priority'] ?? $field['index']; 175 //$field['index'] = $field_set[$key]['priority'] ?? $field['index']; 176 $field['index'] = ! empty( $field_set[$key]['priority'] )? $field_set[$key]['priority'] : $field['index']; 174 177 175 178 if(apply_filters('thwcfe_block_address_field_dynamic_label', true)){ … … 194 197 195 198 if(isset($field['label'])){ 196 $field['label'] = __($field['label'], 'woo-checkout-field-editor-pro'); 199 // $field['label'] = __($field['label'], 'woo-checkout-field-editor-pro'); 200 $field['label'] = THWCFD_Utils::translate_dynamic_text($field['label'], 'label'); 197 201 } 198 202 } … … 225 229 226 230 if(isset($field['label'])){ 227 $field['label'] = __($field['label'], 'woo-checkout-field-editor-pro'); 231 //$field['label'] = __($field['label'], 'woo-checkout-field-editor-pro'); 232 $field['label'] = THWCFD_Utils::translate_dynamic_text($field['label'], 'label'); 228 233 } 229 234 } … … 252 257 case 'email': 253 258 if (!empty($field_value) && !is_email($field_value)) { 254 // Translators: %s is the title of the field being validated.255 259 $errors->add( 256 260 'invalid_email_field', 257 261 sprintf( 262 /* translators: %s is the title of the field being validated. */ 258 263 __('The provided %s is not a valid email address.', 'woo-checkout-field-editor-pro'), 259 264 esc_html($field_properties['title'] ?? 'value') … … 265 270 case 'phone': 266 271 if (!empty($field_value) && !\WC_Validation::is_phone($field_value)) { 267 // Translators: %s is the title of the field being validated.272 268 273 $errors->add( 269 274 'invalid_phone_field', 270 275 sprintf( 276 // translators: %s is the title of the field being validated. 271 277 __('The provided %s is not a valid phone number.', 'woo-checkout-field-editor-pro'), 272 278 esc_html($field_properties['title'] ?? 'value') … … 278 284 case 'postcode': 279 285 if (!empty($field_value) && !\WC_Validation::is_postcode($field_value)) { 280 // Translators: %s is the title of the field being validated.286 281 287 $errors->add( 282 288 'invalid_postcode', 283 289 sprintf( 290 // translators: %s is the title of the field being validated. 284 291 __('The provided %s is not a valid postcode.', 'woo-checkout-field-editor-pro'), 285 292 esc_html($field_properties['title'] ?? 'value') -
woo-checkout-field-editor-pro/trunk/changelog.txt
r3370969 r3453503 1 1 == Changelog == 2 = 2.1.6 = 3 * Added compatiblity for Archiva for WooCommerce. 4 * Improved dynamic string translation for WPML. 5 * Added WooCommerce 10.4 compatibility. 6 * Added WordPress 6.9 compatibility. 7 2 8 = 2.1.5 = 3 9 * Added required validation for the checkbox field in the block checkout (WC 9.8+). -
woo-checkout-field-editor-pro/trunk/checkout-form-designer.php
r3370969 r3453503 4 4 * Description: Customize WooCommerce checkout fields(Add, Edit, Delete and re-arrange fields). 5 5 * Author: ThemeHigh 6 * Version: 2.1. 56 * Version: 2.1.6 7 7 * Author URI: https://www.themehigh.com 8 8 * Plugin URI: https://www.themehigh.com 9 * License: GPLv2 or later 9 10 * Text Domain: woo-checkout-field-editor-pro 10 11 * Domain Path: /languages 11 12 * WC requires at least: 3.0.0 12 * WC tested up to: 10. 213 * WC tested up to: 10.4 13 14 */ 14 15 … … 26 27 27 28 if(is_woocommerce_active()) { 28 define('THWCFD_VERSION', '2.1. 5');29 define('THWCFD_VERSION', '2.1.6'); 29 30 !defined('THWCFD_BASE_NAME') && define('THWCFD_BASE_NAME', plugin_basename( __FILE__ )); 30 31 !defined('THWCFD_PATH') && define('THWCFD_PATH', plugin_dir_path( __FILE__ )); -
woo-checkout-field-editor-pro/trunk/includes/class-thwcfd.php
r3370969 r3453503 32 32 public function init(){ 33 33 $this->define_constants(); 34 $this->set_locale();34 //$this->set_locale(); 35 35 $this->define_admin_hooks(); 36 36 $this->define_public_hooks(); … … 53 53 } 54 54 55 private function set_locale() { 56 add_action('plugins_loaded', array($this, 'load_plugin_textdomain')); 57 } 58 59 public function load_plugin_textdomain(){ 55 /************ Note: Manual loading of the plugin text domain is intentionally omitted. 56 * Since WordPress 4.6+, translations for plugins hosted on WordPress.org are loaded automatically using Just-In-Time (JIT) loading. 57 * This plugin requires WordPress 4.9 or higher, so no explicit call to load_plugin_textdomain is needed here. 58 */ 59 60 /*private function set_locale() { 61 // WordPress 4.6+ JIT loading of textdomains. This for backward compatibility logging purpose only. 62 $domain = self::TEXT_DOMAIN; 63 if ( is_textdomain_loaded( $domain ) ) { 64 return; 65 } 66 // Determine locale safely (WP 5.0+) 67 $locale = function_exists( 'determine_locale' ) 68 ? determine_locale() 69 : get_locale(); 70 71 $mofile = WP_LANG_DIR . '/plugins/' . $domain . '-' . $locale . '.mo'; 72 if ( file_exists( $mofile ) ) { 73 load_textdomain( $domain, $mofile ); 74 return; 75 } 76 load_plugin_textdomain( 77 $domain, 78 false, 79 dirname( THWCFD_BASE_NAME ) . '/languages/' 80 ); 81 //plugins_loaded hook not required as load_plugin_textdomain called in init method 82 //add_action('plugins_loaded', array($this, 'load_plugin_textdomain')); 83 }*/ 84 85 /* plugins_loaded hook not required as load_plugin_textdomain called in init method 86 public function load_plugin_textdomain(){ 60 87 $locale = apply_filters('plugin_locale', get_locale(), self::TEXT_DOMAIN); 61 88 62 89 load_textdomain(self::TEXT_DOMAIN, WP_LANG_DIR.'/woo-checkout-field-editor-pro/'.self::TEXT_DOMAIN.'-'.$locale.'.mo'); 63 90 load_plugin_textdomain(self::TEXT_DOMAIN, false, dirname(THWCFD_BASE_NAME) . '/languages/'); 64 } 91 }*/ 65 92 66 93 private function define_admin_hooks() { … … 82 109 add_action( 'admin_init', array($plugin_admin, 'landing_page' ), 10 ); 83 110 add_action( 'admin_init', array($plugin_admin, 'redirect_to_landing_page'), 10 ); 111 add_action( 'admin_head', array($plugin_admin, 'remove_welcome_page_menu')); 84 112 85 113 $themehigh_plugins = new THWCFD_Admin_Settings_Themehigh_Plugins(); -
woo-checkout-field-editor-pro/trunk/includes/utils/class-thwcfd-utils-block.php
r3370969 r3453503 23 23 self::get_default_block_sections(); 24 24 } 25 25 // phpcs:disable WordPress.WP.I18n.TextDomainMismatch 26 26 public static function get_default_block_fields(){ 27 27 … … 186 186 // ]; 187 187 188 return $core_fields;188 return apply_filters( 'thwcfd_default_block_checkout_fields', $core_fields ); 189 189 } 190 190 public static function get_default_block_section_fields($section_name){ … … 305 305 return $field_objects; 306 306 } 307 307 // phpcs:disable WordPress.WP.I18n.TextDomainMismatch 308 308 public static function get_core_fields() { 309 309 -
woo-checkout-field-editor-pro/trunk/includes/utils/class-thwcfd-utils.php
r3221414 r3453503 152 152 'type' => 'textarea', 153 153 'class' => array('notes'), 154 'label' => __('Order Notes', 'woocommerce'), 155 'placeholder' => _x('Notes about your order, e.g. special notes for delivery.', 'placeholder', 'woocommerce') 154 'label' => __('Order Notes', 'woocommerce'), // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch 155 'placeholder' => _x('Notes about your order, e.g. special notes for delivery.', 'placeholder', 'woocommerce') // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch 156 156 ) 157 157 ); … … 248 248 if(isset($options[$value]) && !empty($options[$value])){ 249 249 $value = $options[$value]; 250 $value = THWCFD_Utils::translate_dynamic_text($value, 'option'); 250 251 } 251 252 }elseif($type === 'checkboxgroup' || $type === 'multiselect'){ … … 257 258 $new_value = array(); 258 259 foreach($value_arr as $single_value){ 260 259 261 if(isset($options[$single_value]) && !empty($options[$single_value])){ 260 $new_value[] = $options[$single_value];262 $new_value[] = THWCFD_Utils::translate_dynamic_text($options[$single_value], 'option') ; 261 263 }else{ 262 $new_value[] = $single_value;264 $new_value[] = THWCFD_Utils::translate_dynamic_text($single_value, 'option') ; 263 265 } 264 266 } … … 269 271 270 272 } 271 272 273 return $value; 273 274 } … … 384 385 ----- i18n functions - START ------ 385 386 ***********************************/ 387 388 /** 389 * Legacy helper function. 390 * 391 * This method is no longer responsible for translation. 392 * It is kept for backward compatibility, as it may still be 393 * referenced by older code or third-party integrations. 394 * 395 * @param string $text Text to be escaped. 396 * @return string Escaped text. 397 */ 386 398 public static function t($text){ 387 if(!empty($text)){ 399 400 /*if(!empty($text)){ 388 401 $otext = $text; 389 $text = __($text, 'woo-checkout-field-editor-pro');402 $text = esc_html($text); 390 403 if($text === $otext){ 391 404 $text = __($text, 'woocommerce'); 392 405 } 393 406 } 394 return $text; 395 } 396 407 return $text;*/ 408 return esc_html( $text); 409 } 410 411 /** 412 * Legacy echo helper function. 413 * 414 * This method no longer performs translation. 415 * It is retained for backward compatibility to avoid 416 * breaking existing usages that expect this static method. 417 * 418 * @param string $text Text to be escaped and echoed. 419 * @return void 420 */ 397 421 public static function et($text){ 398 if(!empty($text)){399 $otext = $text;400 $text = __($text, 'woo-checkout-field-editor-pro');401 if($text === $otext){402 $text = __($text, 'woocommerce');403 }404 }422 // if(!empty($text)){ 423 // $otext = $text; 424 // $text = __($text, 'woo-checkout-field-editor-pro'); 425 // if($text === $otext){ 426 // $text = __($text, 'woocommerce'); 427 // } 428 // } 405 429 echo esc_html($text); 406 430 } … … 493 517 return $str; 494 518 } 519 520 /** 521 * Translate dynamic/admin-entered strings with proper fallbacks. 522 * 523 * Translation order: 524 * 1. WPML (string translation) 525 * 2. Plugin gettext (backward compatibility) 526 * 3. WooCommerce core gettext 527 * 528 * @param string $text Original text. 529 * @param string $text_type Type of text: label|placeholder|option. 530 * @return string Translated text. 531 */ 532 public static function translate_dynamic_text( $text, $text_type = 'label' ) { 533 534 if ( empty( $text ) ) { 535 return ''; 536 } 537 538 // Build WPML string key (kept for backward compatibility) 539 $key = 'Field label - ' . $text; 540 if ( $text_type === 'placeholder' ) { 541 $key = 'Field placeholder - ' . $text; 542 } elseif ( $text_type === 'option' ) { 543 $key = 'Field option text - ' . $text; 544 } 545 546 // WPML – preferred for dynamic/admin strings 547 if ( has_filter( 'wpml_translate_single_string' ) ) { 548 $translated = apply_filters( 549 'wpml_translate_single_string', 550 $text, 551 'woo-checkout-field-editor-pro', 552 $key 553 ); 554 555 if ( $translated !== $text ) { 556 return $translated; 557 } 558 } 559 560 // Plugin gettext fallback (backward compatibility) 561 // Supports existing .mo translations before WPML integration. 562 // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText 563 $plugin_translation = __( $text, 'woo-checkout-field-editor-pro' ); 564 565 if ( $plugin_translation !== $text ) { 566 return $plugin_translation; 567 } 568 569 // WooCommerce core fallback 570 // Used only when WooCommerce already provides a translation 571 // in the current locale. 572 // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.TextDomainMismatch 573 return __( $text, 'woocommerce' ); 574 } 495 575 } 496 576 -
woo-checkout-field-editor-pro/trunk/languages/woo-checkout-field-editor-pro.pot
r3370969 r3453503 1 # Copyright (C) 202 5ThemeHigh2 # This file is distributed under the same license as the Checkout Field Editor for WooCommerce plugin.1 # Copyright (C) 2026 ThemeHigh 2 # This file is distributed under the GPLv2 or later. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Checkout Field Editor for WooCommerce 2.1. 5\n"5 "Project-Id-Version: Checkout Field Editor for WooCommerce 2.1.6\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-checkout-field-editor-pro\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 5-09-25T09:17:45+00:00\n"12 "POT-Creation-Date: 2026-01-11T19:23:12+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2. 8.1\n"14 "X-Generator: WP-CLI 2.9.0\n" 15 15 "X-Domain: woo-checkout-field-editor-pro\n" 16 16 … … 30 30 #. Author of the plugin 31 31 msgid "ThemeHigh" 32 msgstr "" 33 34 #: admin/class-thwcfd-admin-form-block-field.php:382 35 msgid "Value" 36 msgstr "" 37 38 #: admin/class-thwcfd-admin-form-block-field.php:471 39 #: admin/class-thwcfd-admin-form-field.php:675 40 msgid "Options" 32 41 msgstr "" 33 42 … … 238 247 msgstr "" 239 248 240 #: admin/class-thwcfd-admin-form-field.php:675241 msgid "Options"242 msgstr ""243 244 249 #: admin/class-thwcfd-admin-form-field.php:683 245 250 #: admin/assets/js/inc/thwcfd-admin-field.js:442 … … 291 296 292 297 #: admin/class-thwcfd-admin-settings-advanced.php:135 293 #: admin/class-thwcfd-admin-settings-general.php:2 59294 #: admin/class-thwcfd-admin-settings-general.php:32 1298 #: admin/class-thwcfd-admin-settings-general.php:266 299 #: admin/class-thwcfd-admin-settings-general.php:328 295 300 msgid "Your changes were saved." 296 301 msgstr "" … … 298 303 #: admin/class-thwcfd-admin-settings-advanced.php:137 299 304 #: admin/class-thwcfd-admin-settings-advanced.php:299 300 #: admin/class-thwcfd-admin-settings-general.php:26 1301 #: admin/class-thwcfd-admin-settings-general.php:3 23305 #: admin/class-thwcfd-admin-settings-general.php:268 306 #: admin/class-thwcfd-admin-settings-general.php:330 302 307 msgid "Your changes were not saved due to an error (or you made none!)." 303 308 msgstr "" … … 305 310 #: admin/class-thwcfd-admin-settings-advanced.php:170 306 311 msgid "Are you sure you want to reset to default settings? all your changes will be deleted." 312 msgstr "" 313 314 #: admin/class-thwcfd-admin-settings-advanced.php:220 315 msgid "Backup and Import Settings" 316 msgstr "" 317 318 #: admin/class-thwcfd-admin-settings-advanced.php:222 319 msgid "Plugin Settings Data" 320 msgstr "" 321 322 #: admin/class-thwcfd-admin-settings-advanced.php:223 323 msgid "You can transfer the saved settings data between different installs by copying the text inside the text box. To import data from another install, replace the data in the text box with the one from another install and click \"Import Settings\"." 324 msgstr "" 325 326 #: admin/class-thwcfd-admin-settings-advanced.php:240 327 msgid "Import Settings" 307 328 msgstr "" 308 329 … … 323 344 #: admin/class-thwcfd-admin-settings-block-fields.php:65 324 345 #: admin/class-thwcfd-admin-settings-general.php:98 325 #: admin/class-thwcfd-admin-settings-general.php: 194346 #: admin/class-thwcfd-admin-settings-general.php:201 326 347 msgid "Edit" 327 348 msgstr "" … … 363 384 #: admin/class-thwcfd-admin-settings-block-fields.php:103 364 385 msgid "Actions" 386 msgstr "" 387 388 #: admin/class-thwcfd-admin-settings-block-fields.php:186 389 #: block/class-thwcfd-block-order-data.php:415 390 #: block/class-thwcfd-block-order-data.php:543 391 #: admin/assets/js/inc/thwcfd-admin.js:97 392 #: admin/assets/js/thwcfd-admin.js:1281 393 msgid "Yes" 365 394 msgstr "" 366 395 … … 380 409 381 410 #: admin/class-thwcfd-admin-settings-block-fields.php:322 382 #: admin/class-thwcfd-admin-settings-general.php:2 79411 #: admin/class-thwcfd-admin-settings-general.php:286 383 412 msgid "Your changes were not saved due to no fields found." 384 413 msgstr "" … … 429 458 msgstr "" 430 459 431 #: admin/class-thwcfd-admin-settings-general.php:2 64432 #: admin/class-thwcfd-admin-settings-general.php:3 26460 #: admin/class-thwcfd-admin-settings-general.php:271 461 #: admin/class-thwcfd-admin-settings-general.php:333 433 462 msgid "Your changes were not saved due to an error." 434 463 msgstr "" … … 440 469 #: admin/class-thwcfd-admin-settings-themehigh-plugins.php:184 441 470 msgid "Other Plugins" 471 msgstr "" 472 473 #: admin/class-thwcfd-admin-settings-themehigh-plugins.php:233 474 msgid "Activated" 475 msgstr "" 476 477 #: admin/class-thwcfd-admin-settings-themehigh-plugins.php:246 478 msgid "Activate" 479 msgstr "" 480 481 #: admin/class-thwcfd-admin-settings-themehigh-plugins.php:267 482 msgid "Install now" 442 483 msgstr "" 443 484 … … 471 512 msgstr "" 472 513 473 #: admin/class-thwcfd-admin.php:144 514 #. translators: %s: Support team link 515 #: admin/class-thwcfd-admin.php:143 516 msgid "" 517 "Our Checkout Field Editor now supports WooCommerce Checkout Blocks! Currently, a few field types are available, and more will be added soon. \n" 518 "\t\t\t\t\t\t\tIf you're using Block Checkout, make sure to switch to the Block Checkout Fields tab, otherwise, your changes won’t be reflected. Have questions or need help? \n" 519 "\t\t\t\t\t\t\tReach out to our %s ." 520 msgstr "" 521 522 #: admin/class-thwcfd-admin.php:146 474 523 msgid " Support team" 524 msgstr "" 525 526 #: admin/thwcfd-landing-page.php:20 527 msgid "Checkout field editor Landing page" 528 msgstr "" 529 530 #: admin/thwcfd-landing-page.php:38 531 msgid "Welcome to Checkout Field Editor!" 532 msgstr "" 533 534 #: admin/thwcfd-landing-page.php:40 535 msgid "We’re excited to have you on board! Now, you can easily customize your WooCommerce checkout using both the Block Checkout Editor and the Classic Checkout Field Editor. Enjoy complete flexibility and control! " 536 msgstr "" 537 538 #: admin/thwcfd-landing-page.php:44 539 msgid "Get Started" 540 msgstr "" 541 542 #: admin/thwcfd-landing-page.php:48 543 msgid "Learn more about both editors to make the most out of your checkout" 544 msgstr "" 545 546 #: admin/thwcfd-landing-page.php:54 547 msgid "Read More!" 548 msgstr "" 549 550 #: admin/thwcfd-landing-page.php:60 551 msgid "We support both Classic and Block Checkout. Choose the one you're using" 552 msgstr "" 553 554 #: admin/thwcfd-landing-page.php:61 555 msgid "Which Checkout Fields should you use?" 556 msgstr "" 557 558 #: admin/thwcfd-landing-page.php:72 559 msgid "Classic Checkout" 560 msgstr "" 561 562 #: admin/thwcfd-landing-page.php:78 563 msgid "Use this if you’re still using the traditional WooCommerce checkout page." 564 msgstr "" 565 566 #: admin/thwcfd-landing-page.php:84 567 msgid "Compatible with older checkout layouts." 568 msgstr "" 569 570 #: admin/thwcfd-landing-page.php:90 571 msgid "Best for users who prefer the classic, non-block experience." 572 msgstr "" 573 574 #: admin/thwcfd-landing-page.php:103 575 msgid "Block Checkout" 576 msgstr "" 577 578 #: admin/thwcfd-landing-page.php:109 579 msgid "Use this if you’ve transitioned to WooCommerce’s new Block-based checkout." 580 msgstr "" 581 582 #: admin/thwcfd-landing-page.php:115 583 msgid "Easier to customize with block elements." 584 msgstr "" 585 586 #: admin/thwcfd-landing-page.php:121 587 msgid "Best for users looking for a more modern, flexible checkout design" 588 msgstr "" 589 590 #: admin/thwcfd-landing-page.php:132 591 msgid "Go with Classic Checkout Editor" 592 msgstr "" 593 594 #: admin/thwcfd-landing-page.php:135 595 msgid "Go with Block Checkout Editor" 596 msgstr "" 597 598 #: admin/thwcfd-landing-page.php:140 599 msgid "Let's Get started" 475 600 msgstr "" 476 601 … … 480 605 msgstr "" 481 606 482 #: block/class-thwcfd-block-order-data.php:414 483 #: block/class-thwcfd-block-order-data.php:542 484 #: admin/assets/js/inc/thwcfd-admin.js:97 485 #: admin/assets/js/thwcfd-admin.js:1281 486 msgid "Yes" 487 msgstr "" 488 489 #: block/class-thwcfd-block-order-data.php:414 490 #: block/class-thwcfd-block-order-data.php:542 607 #: block/class-thwcfd-block-order-data.php:415 608 #: block/class-thwcfd-block-order-data.php:543 491 609 msgid "No" 492 610 msgstr "" 493 611 494 612 #. translators: %s Field label. 495 #: block/class-thwcfd-block.php:18 4613 #: block/class-thwcfd-block.php:186 496 614 msgid "%s (optional)" 497 615 msgstr "" 498 616 499 #: block/class-thwcfd-block.php:258 617 #. translators: %s is the title of the field being validated. 618 #: block/class-thwcfd-block.php:262 500 619 msgid "The provided %s is not a valid email address." 501 620 msgstr "" 502 621 503 #: block/class-thwcfd-block.php:271 622 #. translators: %s is the title of the field being validated. 623 #: block/class-thwcfd-block.php:276 504 624 msgid "The provided %s is not a valid phone number." 505 625 msgstr "" 506 626 507 #: block/class-thwcfd-block.php:284 627 #. translators: %s is the title of the field being validated. 628 #: block/class-thwcfd-block.php:290 508 629 msgid "The provided %s is not a valid postcode." 509 630 msgstr "" 510 631 511 #: includes/class-thwcfd.php:1 48632 #: includes/class-thwcfd.php:176 512 633 msgid "Quick Feedback" 513 634 msgstr "" 514 635 515 #: includes/class-thwcfd.php:1 53516 #: includes/class-thwcfd.php: 184636 #: includes/class-thwcfd.php:181 637 #: includes/class-thwcfd.php:212 517 638 msgid "Get Support" 518 639 msgstr "" 519 640 520 #: includes/class-thwcfd.php:1 57641 #: includes/class-thwcfd.php:185 521 642 msgid "If you have a moment, please let us know why you want to deactivate this plugin" 522 643 msgstr "" 523 644 524 #: includes/class-thwcfd.php: 176645 #: includes/class-thwcfd.php:204 525 646 msgid "This form is only for getting your valuable feedback. We do not collect your personal data. To know more read our " 526 647 msgstr "" 527 648 528 #: includes/class-thwcfd.php: 176649 #: includes/class-thwcfd.php:204 529 650 msgid "Privacy Policy" 530 651 msgstr "" 531 652 532 #: includes/class-thwcfd.php: 180653 #: includes/class-thwcfd.php:208 533 654 msgid "Skip & Deactivate" 534 655 msgstr "" 535 656 536 #: includes/class-thwcfd.php: 186657 #: includes/class-thwcfd.php:214 537 658 msgid "Submit and Deactivate" 538 659 msgstr "" 539 660 540 #: includes/class-thwcfd.php: 187661 #: includes/class-thwcfd.php:215 541 662 msgid "Cancel" 542 663 msgstr "" 543 664 544 #: includes/class-thwcfd.php:4 08665 #: includes/class-thwcfd.php:436 545 666 msgid "Deactivate and " 546 667 msgstr "" 547 668 548 #: includes/class-thwcfd.php:4 10669 #: includes/class-thwcfd.php:438 549 670 msgid "leave a review" 550 671 msgstr "" 551 672 552 #: includes/class-thwcfd.php:4 14673 #: includes/class-thwcfd.php:442 553 674 msgid "Upgraded" 554 675 msgstr "" 555 676 556 #: includes/class-thwcfd.php: 484677 #: includes/class-thwcfd.php:512 557 678 msgid "Upgraded to premium." 558 679 msgstr "" 559 680 560 #: includes/class-thwcfd.php: 491681 #: includes/class-thwcfd.php:519 561 682 msgid "A specific feature is missing" 562 683 msgstr "" 563 684 564 #: includes/class-thwcfd.php: 493685 #: includes/class-thwcfd.php:521 565 686 msgid "Type in the feature" 566 687 msgstr "" 567 688 568 #: includes/class-thwcfd.php: 498689 #: includes/class-thwcfd.php:526 569 690 msgid "Found an error in the plugin/ Plugin was not working" 570 691 msgstr "" 571 692 572 #: includes/class-thwcfd.php:5 00693 #: includes/class-thwcfd.php:528 573 694 msgid "Specify the issue" 574 695 msgstr "" 575 696 576 #: includes/class-thwcfd.php:5 05697 #: includes/class-thwcfd.php:533 577 698 msgid "It was hard to use" 578 699 msgstr "" 579 700 580 #: includes/class-thwcfd.php:5 07701 #: includes/class-thwcfd.php:535 581 702 msgid "How can we improve your experience?" 582 703 msgstr "" 583 704 584 #: includes/class-thwcfd.php:5 12705 #: includes/class-thwcfd.php:540 585 706 msgid "I found a better Plugin" 586 707 msgstr "" 587 708 588 #: includes/class-thwcfd.php:5 14589 #: includes/class-thwcfd.php:5 28709 #: includes/class-thwcfd.php:542 710 #: includes/class-thwcfd.php:556 590 711 msgid "Could you please mention the plugin?" 591 712 msgstr "" 592 713 593 #: includes/class-thwcfd.php:5 26714 #: includes/class-thwcfd.php:554 594 715 msgid "It’s a temporary deactivation - I’m troubleshooting an issue" 595 716 msgstr "" 596 717 597 #: includes/class-thwcfd.php:5 33718 #: includes/class-thwcfd.php:561 598 719 msgid "Not mentioned here" 599 720 msgstr "" 600 721 601 #: includes/class-thwcfd.php:5 35722 #: includes/class-thwcfd.php:563 602 723 msgid "Kindly tell us your reason, so that we can improve" 603 724 msgstr "" 604 725 605 #: public/class-thwcfd-public-checkout.php:543 726 #. translators: %s: Field label 727 #: public/class-thwcfd-public-checkout.php:548 606 728 msgid "<strong>%s</strong> is not a valid number." 607 729 msgstr "" 608 730 609 #: public/class-thwcfd-public-checkout.php:547 731 #. translators: %s: Field label 732 #: public/class-thwcfd-public-checkout.php:553 610 733 msgid "<strong>%s</strong> is not a valid url." 611 734 msgstr "" -
woo-checkout-field-editor-pro/trunk/public/class-thwcfd-public-checkout.php
r3370969 r3453503 196 196 } 197 197 198 public function get_posted_value($key){ 199 $value = isset($_POST[$key]) ? stripslashes($_POST[$key]) : ''; 200 201 if(!$value){ 202 $post_data = isset($_POST['post_data']) ? $_POST['post_data'] : ''; 203 204 if($post_data){ 205 parse_str($post_data, $post_data_arr); 206 $value = isset($post_data_arr[$key]) ? stripslashes($post_data_arr[$key]) : ''; 207 } 208 } 209 198 public function get_posted_value( $key ) { 199 $value = ''; 200 if ( isset( $_POST[ $key ] ) ) { 201 $value = wp_unslash( $_POST[ $key ] ); 202 } 203 if ( '' === $value && isset( $_POST['post_data'] ) ) { 204 $post_data = wp_unslash( $_POST['post_data'] ); 205 206 if ( is_string( $post_data ) ) { 207 parse_str( $post_data, $post_data_arr ); 208 209 if ( isset( $post_data_arr[ $key ] ) ) { 210 $value = $post_data_arr[ $key ]; 211 } 212 } 213 } 210 214 return $value; 211 215 } … … 481 485 $options = array(); 482 486 foreach($options_arr as $key => $value) { 483 $options[$key] = __($value, 'woo-checkout-field-editor-pro'); 487 $value = $this->translate_text($value, 'option'); 488 $options[$key] = $value; 484 489 } 485 490 $new_field['options'] = $options; … … 492 497 493 498 if(isset($new_field['label'])){ 494 $new_field['label'] = __($new_field['label'], 'woo-checkout-field-editor-pro'); 499 //$new_field['label'] = __($new_field['label'], 'woo-checkout-field-editor-pro'); 500 $new_field['label'] = $this->translate_text($new_field['label'], 'label'); 495 501 } 496 502 497 503 if(isset($new_field['placeholder'])){ 498 $new_field['placeholder'] = __($new_field['placeholder'], 'woo-checkout-field-editor-pro'); 504 $new_field['placeholder'] = $this->translate_text($new_field['placeholder'], 'placeholder'); 505 // 506 //$new_field['placeholder'] = __($new_field['placeholder'], 'woo-checkout-field-editor-pro'); 499 507 } 500 508 … … 541 549 if($vname === 'number'){ 542 550 if(!is_numeric($value)){ 551 /* translators: %s: Field label */ 543 552 $err_msg = sprintf( __( '<strong>%s</strong> is not a valid number.', 'woo-checkout-field-editor-pro' ), $flabel ); 544 553 } 545 554 }else if($vname === 'url'){ 546 555 if (!filter_var($value, FILTER_VALIDATE_URL)) { 556 /* translators: %s: Field label */ 547 557 $err_msg = sprintf( __( '<strong>%s</strong> is not a valid url.', 'woo-checkout-field-editor-pro' ), $flabel ); 548 558 } … … 670 680 671 681 $f_type = isset($field['type']) ? $field['type'] : 'text'; 672 $value = esc_html __($value, 'woo-checkout-field-editor-pro');682 $value = esc_html($this->translate_text($value, 'option')); 673 683 if($f_type == 'textarea'){ 674 684 $value = nl2br($value); … … 676 686 677 687 $custom_field = array(); 678 $custom_field['label'] = wp_kses_post( __($label, 'woo-checkout-field-editor-pro'));688 $custom_field['label'] = wp_kses_post($this->translate_text($label, 'label')); 679 689 $custom_field['value'] = $value; 680 690 … … 691 701 */ 692 702 public function order_details_after_customer_details($order){ 703 704 if ( ! $order instanceof WC_Order ) { 705 return; 706 } 693 707 $order_id = THWCFD_Utils::get_order_id($order); 694 708 $fields = THWCFD_Utils::get_checkout_fields($order); … … 698 712 foreach($fields as $key => $field){ 699 713 if(THWCFD_Utils::is_active_custom_field($field) && isset($field['show_in_order']) && $field['show_in_order'] && !THWCFD_Utils::is_wc_handle_custom_field($field)){ 700 $order = wc_get_order( $order_id ); 701 714 // Compatibility for Archiva for WooCommerce. 715 /*if (wc_get_order( $order_id ) && is_a( wc_get_order( $order_id ), 'WC_Order' )) { 716 $order = wc_get_order( $order_id ); // Kept old code unchanged. 717 } else { 718 // Check if $order is a valid WC_Order object 719 $order = is_a($order, 'WC_Order') ? $order : false; 720 if (!$order) { 721 return; 722 } 723 }*/ 724 702 725 // $value = get_post_meta( $order_id, $key, true ); 703 726 $value = $order->get_meta( $key, true ); … … 706 729 $label = isset($field['label']) && $field['label'] ? $field['label'] : $key; 707 730 //$label = esc_attr($label); 708 $label = wp_kses_post(__($label, 'woo-checkout-field-editor-pro')); 731 $label = $this->translate_text($label, 'label'); 732 $label = wp_kses_post($label); 709 733 //$value = wptexturize($value); 710 734 $value = THWCFD_Utils::get_option_text($field, $value); 711 735 712 736 $f_type = isset($field['type']) ? $field['type'] : 'text'; 713 $value = esc_html__($value, 'woo-checkout-field-editor-pro'); 737 $value = $this->translate_text($value, 'option'); 738 $value = esc_html($value); 714 739 if($f_type == 'textarea'){ 715 740 $value = nl2br($value); … … 762 787 $required =' <span class="required" aria-hidden="true">*</span>'; 763 788 }else{ 764 $required = ' <abbr class="required" title="' . esc_attr__( 'required', 'woocommerce' ) . '">*</abbr>'; 789 // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch 790 $required = ' <abbr class="required" title="' . esc_attr__( 'required', 'woocommerce' ) . '">*</abbr>'; 765 791 } 766 792 } else { 793 // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch 767 794 $required = ' <span class="optional">(' . esc_html__( 'optional', 'woocommerce' ) . ')</span>'; 768 795 } … … 822 849 823 850 if (!empty($args['options'])) { 824 $field .= '<select name="' . esc_attr($key) . '[]" id="' . esc_attr($key) . '" class="select ' . esc_attr(implode(' ', $args['input_class'])) . '" multiple="multiple" ' . esc_attr(implode(' ', $custom_attributes)) . ' data-placeholder="' . esc_html__($args['placeholder'], 'woo-checkout-field-editor-pro') . '" >'; 825 foreach ($args['options'] as $option_key => $option_text) { 826 $field .= '<option value="' . esc_attr($option_key) . '" ' . selected(in_array($option_key, $value), 1, false) . '>' . esc_html__($option_text, 'woo-checkout-field-editor-pro') . '</option>'; 851 $placeholder = !empty($args['placeholder']) ? $this->translate_text($args['placeholder'], 'placeholder') : ''; 852 $field .= '<select name="' . esc_attr($key) . '[]" id="' . esc_attr($key) . '" class="select ' . esc_attr(implode(' ', $args['input_class'])) . '" multiple="multiple" ' . esc_attr(implode(' ', $custom_attributes)) . ' data-placeholder="' . esc_attr($placeholder) . '" >'; 853 foreach ($args['options'] as $option_key => $option_text) { 854 $option_text = $this->translate_text( $option_text, 'option' ); 855 $field .= '<option value="' . esc_attr($option_key) . '" ' . selected(in_array($option_key, $value), 1, false) . '>' . esc_html($option_text) . '</option>'; 827 856 } 828 857 $field .= ' </select>'; … … 854 883 855 884 foreach ($args['options'] as $option_key => $option_text) { 856 $field .= '<label><input type="checkbox" name="' . esc_attr($key) . '[]" value="' . esc_attr($option_key) . '"' . checked(in_array($option_key, $value), 1, false) . ' /> ' . esc_html__($option_text, 'woo-checkout-field-editor-pro') . '</label>'; 885 $option_text = $this->translate_text( $option_text, 'option' ); 886 $field .= '<label><input type="checkbox" name="' . esc_attr($key) . '[]" value="' . esc_attr($option_key) . '"' . checked(in_array($option_key, $value), 1, false) . ' /> ' . esc_html($option_text) . '</label>'; 857 887 } 858 888 … … 910 940 911 941 if ($args['label'] && 'checkbox' !== $args['type']) { 912 $field_html .= '<label for="' . esc_attr($label_id) . '" class="' . esc_attr(implode(' ', $args['label_class'])) . '">' . esc_html__($args['label'], 'woo-checkout-field-editor-pro') . $required . '</label>'; 942 $f_label = $this->translate_text($args['label'], 'label'); 943 $field_html .= '<label for="' . esc_attr($label_id) . '" class="' . esc_attr(implode(' ', $args['label_class'])) . '">' . esc_html($f_label) . $required . '</label>'; 913 944 } 914 945 … … 941 972 942 973 if(isset($args['label']) && !empty($args['label'])){ 943 $field = '<p class="form-row '.esc_attr(implode(' ', $args['class'])).'" id="'.esc_attr($key).'_field" name="'.esc_attr($key).'" >'. esc_html__($args['label'], 'woo-checkout-field-editor-pro') .'</ p >'; 974 $f_label = $this->translate_text($args['label'], 'label'); 975 $field = '<p class="form-row '.esc_attr(implode(' ', $args['class'])).'" id="'.esc_attr($key).'_field" name="'.esc_attr($key).'" >'. esc_html_($f_label) .'</ p >'; 944 976 } 945 977 … … 955 987 if(isset($args['label']) && !empty($args['label'])){ 956 988 $title_type = isset($args['title_type']) && !empty($args['title_type']) ? $args['title_type'] : 'label'; 957 958 $heading_html .= '<'. esc_attr($title_type) .' class="'. esc_attr(implode(' ', $args['label_class'])) .'" >'. esc_html __($args['label'], 'woo-checkout-field-editor-pro') .'</'. $title_type .'>';989 $f_label = $this->translate_text($args['label'], 'label'); 990 $heading_html .= '<'. esc_attr($title_type) .' class="'. esc_attr(implode(' ', $args['label_class'])) .'" >'. esc_html($f_label) .'</'. $title_type .'>'; 959 991 } 960 992 … … 972 1004 973 1005 } 1006 1007 /** 1008 * Translate dynamic strings with WPML / Polylang, 1009 * fallback to WooCommerce core translations when applicable. 1010 * 1011 * @param string $text Original text. 1012 * @param string $key Stable translation key. 1013 * @return string 1014 */ 1015 private function translate_text( $text, $text_type = 'label' ) { 1016 1017 if ( empty( $text ) ) { 1018 return ''; 1019 } 1020 $key = 'Field label - ' . $text; 1021 if ( $text_type === 'placeholder' ) { 1022 $key = 'Field placeholder - ' . $text; 1023 } elseif ( $text_type === 'option' ) { 1024 $key = 'Field option text - ' . $text; 1025 } 1026 1027 // WPML (preferred for dynamic/admin strings) 1028 if ( has_filter( 'wpml_translate_single_string' ) ) { 1029 $translated = apply_filters( 1030 'wpml_translate_single_string', 1031 $text, 1032 'woo-checkout-field-editor-pro', 1033 $key 1034 ); 1035 1036 if ( $translated !== $text ) { 1037 return $translated; 1038 } 1039 } 1040 1041 // Polylang, 2nd preference for dynamic/admin strings, consider when add support for Polylang is requested 1042 // if ( function_exists( 'pll__' ) ) { 1043 // $translated = pll__( $text ); 1044 // if ( $translated !== $text ) { 1045 // return $translated; 1046 // } 1047 // } 1048 1049 // Plugin gettext fallback. 1050 // This is kept for backward compatibility to support existing translations 1051 // that rely on the plugin text domain (.mo files) before WPML integration. 1052 // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText 1053 $plugin_translation = __( $text, 'woo-checkout-field-editor-pro' ); 1054 1055 if ( $plugin_translation !== $text ) { 1056 return $plugin_translation; 1057 } 1058 1059 // WooCommerce core fallback, Used only when WooCommerce already provides a translation for this string in the current locale. 1060 // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.TextDomainMismatch 1061 return __( $text, 'woocommerce' ); 1062 } 974 1063 975 1064 } -
woo-checkout-field-editor-pro/trunk/readme.txt
r3370969 r3453503 4 4 Tags: Checkout Manager, Checkout Field Editor, WooCommerce Checkout, WooCommerce Checkout Field, Custom fields 5 5 Requires at least: 4.9 6 Tested up to: 6. 86 Tested up to: 6.9 7 7 Requires PHP: 5.6 8 Stable tag: 2.1. 58 Stable tag: 2.1.6 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 25 25 ==How WooCommerce Checkout Field Editor (Checkout Manager) simplifies customization? == 26 26 27 [youtube https://youtu.be/eMGjviRHyfo?si=IC5et0Mqe7Yf1Nk_] 28 27 29 ✳️ **Complete Checkout Field Customization →** Effortlessly add, edit, remove, and rearrange fields. 28 30 … … 37 39 **👉Note:** Block Compatibility → Our Checkout Field Editor (Checkout Manager) for WooCommerce now supports WooCommerce Checkout Blocks, allowing customization with Text, Select, Radio, and Checkbox fields, plus validation for Email, Phone, and URL. More field types will be added in upcoming updates. 38 40 39 [Try Demo]((https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=re adme&utm_campaign=try_demo)) | [Documentation](https://www.themehigh.com/docs/docs-category/checkout-field-editor-for-woocommerce/?utm_source=wcfe_free&utm_medium=readme&utm_campaign=help_docs) | [Get Pro ](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=readme&utm_campaign=wcfe_upgrade_link)41 [Try Demo]((https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=try_demo)) | [Documentation](https://www.themehigh.com/docs/docs-category/checkout-field-editor-for-woocommerce/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=pro_doc) | [Get Pro ](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_upgrade_link) 40 42 41 43 ==🔥 EXPLORE WHAT OUR FREE VERSION OFFERS == … … 74 76 Users can **edit, delete and enable/disable these fields**. With the simple drag-and-drop interface, users can also easily **reposition fields** to meet their business needs effortlessly. 75 77 78 [youtube https://youtu.be/6UXexzGIn-8?si=sUiapwT3z6tb5NrY] 79 76 80 = ✅ VALIDATE THE CHECKOUT FIELDS = 77 81 Validate both custom and default checkout fields to prevent incomplete or incorrect submissions, enhancing the user experience and reducing errors during checkout. … … 101 105 ==🔥 WHY SWITCH TO PRO?== 102 106 103 While the free version of [Checkout Field Editor for WooCommerce](https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=re adme&utm_campaign=try_demo%29) offers essential features to enhance your checkout pages, the premium version offers full control over your checkout process & easily customize WooCommerce Checkout Fields – Works with Both Classic & Block Checkout!—ensuring a better customer experience and higher revenue such as:107 While the free version of [Checkout Field Editor for WooCommerce](https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=try_demo) offers essential features to enhance your checkout pages, the premium version offers full control over your checkout process & easily customize WooCommerce Checkout Fields – Works with Both Classic & Block Checkout!—ensuring a better customer experience and higher revenue such as: 104 108 105 109 **👉 4 additional field types for more flexibility** … … 111 115 **👉 Compatibility with third-party plugins for extended functionality** 112 116 113 [GET FULL ACCESS WITH PREMIUM NOW !](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/ )117 [GET FULL ACCESS WITH PREMIUM NOW !](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_upgrade_link) 114 118 115 119 = 👉 WPML Compatibility = 116 The Extra product options plugin is WPML compatible and it lets you create product pages in multiple languages.120 The WooCommerce Checkout Field Editor works smoothly with WPML, allowing you to translate checkout field labels and text into multiple languages for a better multilingual checkout experience. 117 121 118 122 == 🔥 SEE OUR PREMIUM FEATURES == 119 [Try Demo]((https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=re adme&utm_campaign=try_demo)) | [Documentation](https://www.themehigh.com/docs/docs-category/checkout-field-editor-for-woocommerce/?utm_source=wcfe_free&utm_medium=readme&utm_campaign=help_docs) | [Get Pro ](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=readme&utm_campaign=wcfe_upgrade_link)123 [Try Demo]((https://flydemos.com/wcfe/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=try_demo)) | [Documentation](https://www.themehigh.com/docs/docs-category/checkout-field-editor-for-woocommerce/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=pro_doc) | [Get Pro ](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_upgrade_link) 120 124 121 125 = ✅ ADD 4 ADDITIONAL FIELDS TYPES TO CHECKOUT PAGE = … … 126 130 4. Label 127 131 128 🆕 **👉 Note:** The Pro version lets you add an extra checkout field type **Date Picker** when using Block Checkout.132 🆕 **👉 Note:** The Pro version lets you add an extra checkout field type **Date Picker** when using Block Checkout. 129 133 130 134 = ✅ POSITION SECTIONS AT 14 POSITIONS = … … 255 259 256 260 == OTHER USEFUL LINKS== 257 👉 [VIEW ALL FEATURES](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/ )258 👉 [GET DOCUMENTATION](https://www.themehigh.com/docs/category/checkout-field-editor-for-woocommerce/ )259 👉 [GET THEMEHIGH SUPPORT](https://www.themehigh.com/docs/support/ )261 👉 [VIEW ALL FEATURES](https://www.themehigh.com/product/woocommerce-checkout-field-editor-pro/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=wcfe_upgrade_link) 262 👉 [GET DOCUMENTATION](https://www.themehigh.com/docs/category/checkout-field-editor-for-woocommerce/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=pro_doc) 263 👉 [GET THEMEHIGH SUPPORT](https://www.themehigh.com/docs/support/?utm_source=wcfe_free&utm_medium=referral&utm_campaign=cfe_support) 260 264 👉 [JOIN COMMUNITY](https://www.facebook.com/groups/themehigh/) 261 265 👉 FOLLOW US ON [Facebook](https://www.facebook.com/ThemeHigh-319611541768603/), [LinkedIn](https://www.linkedin.com/company/themehigh/), [Twitter](https://twitter.com/themehigh/) , [YouTube](https://www.youtube.com/channel/UC-_uMXaC_21j1Y2_nGjTyvg/) & [Reddit](https://www.reddit.com/r/themehigh). … … 328 332 == Screenshots == 329 333 1. WooCommerce > Checkout Form 330 2. Add newfield334 2. Add and edit field 331 335 3. New field popup form 332 4. Edit existing field 333 5. Edit field popup form 334 6. Rearrange fields (change field's display order) 335 7. Reset to default settings 336 8. Save changes 337 9. Locale override settings 336 4. Edit field popup form 337 5. Rearrange fields (change field's display order) 338 6. Reset and save fields 339 7. Advance settings 340 8. Custom field (Text) 341 9. Custom field (Radio) 342 10. Custom field (Date) 343 11. Block Data fields 344 12. Block checkout custom fields( Radio and Text) 338 345 339 346 == Changelog == 347 = 2.1.6 = 348 * Added compatiblity for Archiva for WooCommerce. 349 * Improved dynamic string translation for WPML. 350 * Added WooCommerce 10.4 compatibility. 351 * Added WordPress 6.9 compatibility. 340 352 341 353 = 2.1.5 = … … 344 356 * Added WooCommerce 10.2 compatibility. 345 357 346 347 358 = 2.1.4 = 348 359 * Fixed shipping calculation issue when "Hide shipping costs until an address is entered" is enabled (WooCommerce 9.8+ compatibility).
Note: See TracChangeset
for help on using the changeset viewer.