public function hookCallback()
    {
        $name = $this->getModel()->getName();

        // Check Ajax referer
        check_ajax_referer($name, 'nonce');

        // Call custom callback function
        $data = $this->callback();

        // Build JSON data
        wp_send_json_success($data);

        // Stops everything
        wp_die();
    }
public function hookCallback()
    {
        $name = $this->getModel()->getName();

        // Check Ajax referer
        check_ajax_referer($name, 'nonce');

        // Call custom callback function
        $data = $this->callback();

        // Build JSON data
        wp_send_json_success($data);

        // Stops everything
        wp_die();
    }
public function hookCallback ( ) { $ name = $ this -> getModel ( ) -> getName ( ) ; // Check Ajax referer check_ajax_referer ( $ name , 'nonce' ) ; // Call custom callback function $ data = $ this -> callback ( ) ; // Build JSON data wp_send_json_success ( $ data ) ; // Stops everything wp_die ( ) ; }
Hook callback method.
Hook callback method .