Created
          August 24, 2016 18:46 
        
      - 
      
 - 
        
Save Bobz-zg/9cff6625c354ef3b8d46e0ece9242294 to your computer and use it in GitHub Desktop.  
    Filter WordPress posts by custom taxonomy term with AJAX
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| function assets() { | |
| wp_enqueue_script('tuts/js', 'scripts/tuts.js', ['jquery'], null, true); | |
| wp_localize_script( 'tuts/js', 'bobz', array( | |
| 'nonce' => wp_create_nonce( 'bobz' ), | |
| 'ajax_url' => admin_url( 'admin-ajax.php' ) | |
| )); | |
| } | |
| add_action('wp_enqueue_scripts', 'assets', 100); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment