just open the link by computer it works fine when you click on each days but the same thing does not work in mobile browser. thanks

 function total_lunch_scripts(){
wp_enqueue_script('script-name', plugin_dir_url(__FILE__) . '/js/example.js', array('jquery'), '1.0.0', true);
wp_localize_script('script-name', 'MyAjax', array(

    'ajaxurl' => admin_url('admin-ajax.php'),

    'security' => wp_create_nonce('my-special-string')
));

}

add_action(‘wp_enqueue_scripts’, ‘total_lunch_scripts’);

function lunch_action_callback(){
check_ajax_referer('my-special-string', 'security');
$date = $_POST['today_date'];
lunch_front_today($date);

}

add_action(‘wp_ajax_lunch_action’, ‘lunch_action_callback’);enter link description here

Read more here: why wordpress ajax does not work in mobile browser?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: