Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // shortcode to grab a cookie
- // usage: [cookie name='whatever']
- // paste this code into your theme's functions.php file
- if (!function_exists('ch_get_cookie')) {
- function ch_get_cookie($atts) {
- extract(shortcode_atts(array(
- 'name' => null
- ), $atts));
- $output = $_COOKIE[$name];
- return $output;
- }
- }
- add_shortcode('cookie', 'ch_get_cookie');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement