source/php/Module/Posts/Posts.php
public function getTaxonomyValues()
    {
        if (!isset($_POST['tax']) || empty($_POST['tax'])) {
            echo '0';
            die();
        }

        $taxonomy = $_POST['tax'];
        $post = $_POST['post'];

        $result = array(
            'tax' => get_terms($taxonomy, array(
                'hide_empty' => false,
            )),
            'curr' => get_field('posts_taxonomy_value', $post)
        );

        echo json_encode($result);
        die();
    }
public function getTaxonomyValues()
    {
        if (!isset($_POST['tax']) || empty($_POST['tax'])) {
            echo '0';
            die();
        }

        $taxonomy = $_POST['tax'];
        $post = $_POST['post'];

        $result = array(
            'tax' => get_terms($taxonomy, array(
                'hide_empty' => false,
            )),
            'curr' => get_field('posts_taxonomy_value', $post)
        );

        echo json_encode($result);
        die();
    }
public function getTaxonomyValues ( ) { if ( ! isset ( $ _POST [ 'tax' ] ) || empty ( $ _POST [ 'tax' ] ) ) { echo '0' ; die ( ) ; } $ taxonomy = $ _POST [ 'tax' ] ; $ post = $ _POST [ 'post' ] ; $ result = array ( 'tax' => get_terms ( $ taxonomy , array ( 'hide_empty' => false , ) ) , 'curr' => get_field ( 'posts_taxonomy_value' , $ post ) ) ; echo json_encode ( $ result ) ; die ( ) ; }
AJAX CALLBACK
Gets a taxonomies available values
@return void
AJAX CALLBACK Gets a taxonomies available values