It allows you to read cookie-values using Beaver Themer Connector and use Conditional Logic to hide show seperate nodes using cookie values..
For security measures you will need to write the AJAX yourself, but example file on how to do that can be found here, in the example folder https github com badabingbreda cookie-connector-for-themer.
Conditional Logic filter has parameter to set default value for whenever it doesn't return anything.
Cookie Connector for Themer enqueues script that registers cookieConnector object, which handles the security and sending of requests..
The parameter is the actionname that is going to be called in the PHP script, so in this example the part after 'wp ajax and 'wp ajax nopriv .
You can also add extra, optional, third parameter debug that will add console log dump of the response, should you need to know what's being answered.
Clicking the link wil trigger AJAX call that will set cookie on the device, if their browser allows it..
Done unsetting cookie $cookie name} ) ) } else if { setcookie + $cookie valid, COOKIEPATH, COOKIE DOMAIN, isset, true ) wp send json ( array ( 'success => true, 'message =>.
It's advised to use wp send json with parameter so that you check it in your javascript and add actions after sending cookieConnector command, for instance reload of the page or forwarding to url that you received from the server based on the click..
When successful it will display alert on the browser and reload the page after 1.5 seconds.. version history 1.0.1 Updated example code 1.0.0 Initial release ...
Read more