Changeset 490744
- Timestamp:
- 01/16/2012 07:37:59 PM (14 years ago)
- File:
-
- 1 edited
-
abtest/trunk/abtest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
abtest/trunk/abtest.php
r490686 r490744 18 18 // Ensure that widgets can also contain A/B Test shortcodes 19 19 add_filter('widget_text', 'do_shortcode'); 20 add_filter('widget_title', 'do_shortcode'); 21 add_filter('the_title', 'do_shortcode'); 22 23 // Use the jQuery framework 20 24 wp_enqueue_script("jquery"); 21 25 … … 168 172 } 169 173 174 add_action('wp_head', 'abtest_ob_start'); 175 function abtest_ob_start() { 176 if (get_option('abtest_do_shortcode_on_output_buffer')) { 177 ob_start('abtest_ob_callback'); 178 } 179 } 180 181 add_action('wp_footer', 'abtest_ob_end'); 182 function abtest_ob_end() { 183 if (get_option('abtest_do_shortcode_on_output_buffer')) { 184 ob_end(); 185 } 186 } 187 188 function abtest_ob_callback($content) { 189 return do_shortcode($content); 190 } 191 170 192 // [abtest experiment="123"] 171 193 add_shortcode( 'abtest', 'abtest_handle_shortcode' );
Note: See TracChangeset
for help on using the changeset viewer.