title: Wordpress script localization in_category
body: <p>I have localized a script in my functions.php as follows:</p>
  
  <pre><code>wp_enqueue_script('script', get_template_directory_uri() . '/js/script.js', 'jquery', false);
  $scriptParams = array( 'catWork' =&gt; in_category('9'), 'catNews' =&gt; in_category('10'), 'test' =&gt; 'localized'  );
  wp_localize_script('script', 'scriptLocalize', $scriptParams);
  </code></pre>
  
  <p>I am then querying 2 separate categories and outputting thumbnails in 2 separate sections on the same page. I am loading in content via ajax when I click a thumbnail, but I need to detect what category the post is in with my javascript. Example:</p>
  
  <pre><code>$('.thumbnail').click(function() {
      if (scriptLocalize.catWork) {
        // Do something
      } else if (scriptLocalize.catNews) {
        // Do something else
      }
  }
  </code></pre>
  
  <p>However, it does not seem to work. I am running the same thing on my search results page, which is running a general post loop, and it works fine. Is it not working because I am querying a particular category in this case? I know the script is localized, because if i run an alert on the 'test' variable it alerts 'localized' as it's supposed to.</p>
  
  <p>Any ideas?</p>