how can I get the current wp-piwik site id?
-
I have wp-piwik installed as a Network Plugin where it takes the “central approach”.
I have a javascript file that needs access to the site id that wp-piwik creates for sites on the network. It would be super easy if the piwik site id were the same id as the multisite site id in wp. In my functions.php file, I could have just gone:
wp_localize_script( 'js-config', 'ajaxInfo', array( 'site_id' => get_current_blog_id(), 'site_name' => $siteName, 'logo' => get_header_image() ) );
And then used the id in my js file like:
someFunctionThatTakesTheSiteId(ajaxInfo.site_id);
but they’re not the same and i’m not sure how to get access to the current piwik site id. Do you have any functions or anything I can use to localize the id for my scripts?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘how can I get the current wp-piwik site id?’ is closed to new replies.