GREAT
I was able to implement it into my own site white plugin to use with a custom short code.
Works like a charm. That was very helpful of you.
Here is my code for others to use. Just place it in your custom functions.php
// shortcode set a cookie
add_shortcode('xxx_set_cookie', 'xxx_set_cookie');
function xxx_set_cookie($atts){
$atts = shortcode_atts( array(
'cookiename' => '',
), $atts );
print '
<!-- set a cookie start -->
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery.pm_cookie(
''.$atts["cookiename"].'', // The cookie name that is set to manual.
true, // Setting a cookie value of true.
'10 years', // Plain english time frame.
'/' // Cookie path of / means site wide.
);
});
</script>
<!-- set a cookie end -->
';
}
Now you can place/set a cookie with a shortcode
[xxx_set_cookie cookiename="popmake-auto-open-xxx"]
Maybe you can give me a example on how to delete that cookie again?
I would place it in the goodbye page when someone unsubscribes from my newsletter.
regards
Juergen
WordPress ...
ما را در سایت WordPress دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 318
تاريخ: جمعه
8 مرداد
1395 ساعت: 11:48