<script type="text/javascript"> Attribution.track(<?php echo '"' . esc_js($event) . '"'; if (!empty($properties)) { echo ', ' . json_encode(Attribution_Analytics_WordPress::esc_js_deep($properties)); } else { echo ', {}'; } if (!empty($options)) { echo ', ' . json_encode(Attribution_Analytics_WordPress::esc_js_deep($options)); } ?> ); <?php if ($http_event) { ?> Attribution.ajaxurl = "<?php echo esc_url(admin_url('admin-ajax.php')); ?> "; jQuery( document ).ready( function( $ ) { var data = { action : 'attribution_unset_cookie', key : '<?php echo esc_js($http_event); ?> ', },
/** * Used in our activation hook to set up our default settings. * * @since 1.0.0 * * @return void */ public static function setup_settings() { $settings = get_option(Attribution_Analytics_WordPress::get_instance()->get_option_name()); if (!empty($settings)) { return; } update_option(Attribution_Analytics_WordPress::get_instance()->get_option_name(), Attribution_Analytics_WordPress::get_instance()->defaults); }
/** * [exclude_custom_post_types description] * * @todo If no post types exist, we shouldn't show this setting at all. * @return [type] [description] */ public static function exclude_custom_post_types() { $cpts = get_post_types(array('public' => true, '_builtin' => false), 'objects'); $settings = Attribution_Analytics_WordPress::get_instance()->get_settings(); $name = Attribution_Analytics_WordPress::get_instance()->get_option_name() . '[exclude_custom_post_types][]'; $settings['exclude_custom_post_types'] = isset($settings['exclude_custom_post_types']) ? $settings['exclude_custom_post_types'] : array(); foreach ($cpts as $cpt) { ?> <label for="exclude_custom_post_types_<?php echo esc_attr($cpt->name); ?> "> <input name="<?php echo esc_attr($name); ?> " type="checkbox" id="exclude_custom_post_types_<?php echo esc_attr($cpt->name); ?> " value="<?php echo esc_attr($cpt->name); ?> " <?php checked(in_array($cpt->name, (array) $settings['exclude_custom_post_types'])); ?> /> <?php echo esc_html($cpt->label); ?> <br /> </label> <?php } ?> <p class="description"><?php _e('Select which, if any, custom post types to exclude tracking on. Selecting a post type here will exclude tracking on the single and archive pages for the post type.', 'attribution'); ?> </p> <?php }
public function setUp() { parent::setUp(); $this->object = Attribution_Analytics_WordPress::get_instance(); }