Hello everyone, there is a task to get a rubric into a variable, then use AJAX to get this variable for further manipulations with it in Jquery.
<?php add_action('wp_ajax_my_action', 'my_action'); function my_action(){ $pharmacies = get_category(22); echo json_encode($pharmacies); wp_die(); } ?> The task in the php code on request to transfer the variable, in AJAX to get it, help to implement.