Ajax on the Administration Side of plugin – wp_localize_script – how to pass value from JQuery to PHP function in class?

You put your value JS variable that you created in the data that gets sent to your php function via ajax like:

var data = {
    'action': 'get_etim',
    'whatever': ajax_object.we_value,
    'select_value': value   
};

Then in the php function that Ajax sends to you can use select_value the same way you used whatever in your code like:

echo “Whatever is: “ . $_POST[‘whatever’] . “, and Select value is: “ . $_POST[‘select_value’];

Don’t forget to use a nonce, sanitize input data, and escape output.