When fix WordPress Standard data not sent accurately? What i need data sent accurately and standard also fix? [closed]
Question
i am developing WordPress woo-commerce plugin.every think working fine but when I sent data with WordPress standard data not sent accurately. Without a standard, it working fine. I use almost every standard esc_attr,esc_html,esc_url,wp_kase,wp_kases_post,wp_kses_allowed_html.below are code.
if ( ! empty( WC()->session->get( 'WhatsApp_cart' ) ) ) {
$cart_session = WC()->session->get( 'WhatsApp_cart' );
foreach ( $cart_session as $values ) {
if ( 'yes' === get_option( 'WhattsApp_Advance_Check_fld3' ) ) {
$price = $values[2];
} else {
$price = '';
}
if ( 'yes' === get_option( 'WhattsApp_Advance_Check_fld' ) ) {
$title = $values[1];
} else {
$title = '';
}
$whatsapp_info[] = array(
'serial_no' => $i++,
'name' => $title,
'link' => $values[6],
'price' => $price,
'quantity' => $values[3],
);
}
$text = '';
foreach ( $whatsapp_info as $values ) {
$text .= ' Serial No: ' . $values['serial_no'];
$text .= ' Name: ' . $values['name'];
$text .= ' Product link: ' . $values['link'] . '%0D%0A';
$text .= ' Price: ' . $values['price'];
$text .= ' Quantity: ' . $values['quantity'] . '%0D%0A';
}
$link = 'https://web.whatsapp.com/send?phone=' . $phone . '&text= Name: ' . $whatsapp_name . '%0D%0A Email: ' . $whatsapp_email . '%0D%0A Message:' . $whatsapp_message . '%0D%0A' . $txt_final . '%0D%0A' . $text . '%0D%0A';
}
$new_tab = get_option( sanitize_text_field( 'WhattsApp_Check_fld' ) );
if ( '_blank' === $new_tab ) {
?>
<script>
window.open('<?php echo wp_kses_allowed_html( $link ); ?>');
location.reload();
</script>
<?php
} else {
?>
<script>
window.open('<?php echo wp_kses_post( $link ); ?>','_self');
</script>
<?php
}
}
0
3 months
0 Answers
10 views
0
Leave an answer
You must login or register to add a new answer .