Tag Info

Hot answers tagged

2

To pass data from js back to PHP simplest way is use json_encode or, in WP, its wrappers wp_send_json, wp_send_json_error and wp_send_json_success. Usage example: On PHP side function get_latest_product_meta() { $post_id = (int) filter_input(INPUT_GET, 'post_id', FILTER_SANITIZE_NUMBER_INT); $post_id or wp_send_json_error(); // array_shift ...



Only top voted, non community-wiki answers of a minimum length are eligible