Function Reference: geodir_payment_localize_all_js_msg
Summary
Outputs translated JS text strings.
Global Values
- Path
- ($path_location_url) (required) of current file location.
- Default: None
Change Log
Since: 1.0.0
Source Code
function geodir_payment_localize_all_js_msg() { global $path_location_url; $checkout_page_link = (geodir_payment_checkout_page_id()) ? get_page_link( geodir_payment_checkout_page_id() ) : ''; $arr_alert_msg = array( 'geodir_payment_admin_url' => admin_url('admin.php'), 'geodir_payment_admin_ajax_url' => admin_url('admin-ajax.php'), 'geodir_want_to_delete_price' =>__('Are you sure want to delete price?','geodir_payments'), 'geodir_payment_enter_title' =>__('Please enter Title','geodir_payments'), 'geodir_payment_coupon_code' =>__('Please enter coupon code.','geodir_payments'), 'geodir_payment_select_post_type' =>__('Please select post type.','geodir_payments'), 'geodir_payment_enter_discount' =>__('Please enter discount amount.','geodir_payments'), 'geodir_payment_delete_coupon' =>__('Are you sure want to delete coupon?','geodir_payments'), 'geodir_payment_recur_times_msg' =>__('Recurring times must be blank or greater than 1','geodir_payments'), 'authorizenet_cardholder_name_empty' =>__('Please enter Cardholder name', 'geodir_payments'), 'authorizenet_cc_number_empty' =>__('Please enter card number', 'geodir_payments'), 'authorizenet_cc_date_empty' =>__('Please enter expire date', 'geodir_payments'), 'ajax_invoices_nonce' => wp_create_nonce( 'ajax_invoices_nonce' ), 'geodir_pay_invoice_confirm' => __( 'Are you sure want to pay for this invoice?', 'geodir_payments' ), 'geodir_send_invoice_confirm' => __( 'Are you sure want to send the invoice via email?', 'geodir_payments' ), 'geodir_checkout_link' => $checkout_page_link, ); foreach ( $arr_alert_msg as $key => $value ) { if ( !is_scalar($value) ) continue; $arr_alert_msg[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8'); } $script = "var geodir_payment_all_js_msg = " . json_encode($arr_alert_msg) . ';'; echo ''; }