Changeset 3221823
- Timestamp:
- 01/13/2025 09:27:55 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
skyword-plugin/tags/2.5.3/php/class-skyword-shortcode.php
r3220301 r3221823 5 5 function __construct() { 6 6 add_shortcode('cf', array($this, 'customfields_shortcode')); 7 add_shortcode('skyword_tracking ', array(7 add_shortcode('skyword_tracking_tag', array( 8 8 $this, 9 'skyword_tracking '9 'skyword_tracking_tag' 10 10 )); 11 11 add_shortcode('skyword_anonymous_tracking', array( … … 28 28 * Append the standard Skyword tracking tag 29 29 */ 30 function skyword_tracking ($atts) {30 function skyword_tracking_tag($atts) { 31 31 if ( isset( $atts['id'] ) ) 32 32 $id = $atts['id']; 33 33 else 34 34 $id = get_post_meta(get_the_ID(), 'skyword_content_id', true); 35 return "<script async='' type='text/javascript' src='//tracking.skyword.com/tracker.js?contentId={$id}'></script>";35 return wp_enqueue_script('skyword-tracking'); 36 36 } 37 37 … … 44 44 else 45 45 $id = get_post_meta(get_the_ID(), 'skyword_content_id', true); 46 return "<script async='' type='text/javascript' src='//tracking.skyword.com/tracker.js?contentId={$id}&anonymize=yes'></script>";46 return wp_enqueue_script('skyword-anonymous-tracking'); 47 47 } 48 48 … … 95 95 } 96 96 97 function register_tracking_scripts() { 98 wp_register_script( 'skyword-tracking', '//tracking.skyword.com/tracker.js'); 99 wp_register_script( 'skyword-anonymous-tracking', '//tracking.skyword.com/tracker.js?anonymize=yes'); 100 } 101 102 add_action( 'wp_enqueue_scripts', 'register_tracking_scripts' ); 103 97 104 global $custom_shortcodes; 98 105 $custom_shortcodes = new Skyword_Shortcode;
Note: See TracChangeset
for help on using the changeset viewer.