WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been using the TW-SACK library in my plugin using the below code:

    <?php wp_print_scripts(array('sack')); ?>
    <script type="text/javascript">
        where_go_count = new sack("<?php bloginfo( 'url' ); ?>/index.php");    
        where_go_count.setVar( "wherego_id", <?php echo $id ?> );
        where_go_count.setVar( "wherego_sitevar", document.referrer );
        where_go_count.method = 'GET';
        where_go_count.onError = function() { return false };
        where_go_count = null;

This used to be the standard format of code on https://codex.wordpress.org/AJAX_in_Plugins, which has since changed.

I am not sure as to how I can modify the above code to use the new format with wp_ajax_ajax

Appreciate any guidance on this.

share|improve this question
Note that you shouldn't be using wp_print_scripts(). – RRikesh Apr 15 '13 at 7:35
Agreed. But, I'd like to change the entire SACK query and not just wp_print_scripts – Ajay Apr 21 '13 at 8:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.