WordPress.org

Ready to get started?Download WordPress

Forums

Don't run function if specific cookie exists (3 posts)

  1. kevinweber
    Member
    Posted 1 year ago #

    Imagine:
    As soon as someone clicks on a link, a cookie should be saved.
    After the user has clicked on the link and the cookie has been saved, a certain wordpress function should not be executed for the next days.

    How do I realise that?

    Best regards,
    Kevin

  2. bcworkz
    Member
    Posted 1 year ago #

    Well, a portion would have to be executed each time to check the cookie date and only do something meaningful if so many days have passed, else just return without doing anything else.

    You have to run code to decide if other code shouldn't run.

  3. kevinweber
    Member
    Posted 1 year ago #

    Okay, thanks!
    Could you please give/recommend me a piece of code?

    Best wishes,
    Kevin

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.