• Resolved sdowney

    (@sdowney)


    Thanks for this great plugin! Can you explain some more about the purpose of the “run everywhere”, “run in admin only”, “run in front end only” and “run once” radio buttons?

    When would it be useful to choose something OTHER than “run everywhere”?

    Does “run in admin only” mean that the snippet only runs on admin pages?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    That is correct, “run in admin only” means the snippet will only be fetched and executed on wp-admin pages. Programmatically, this is when the is_admin() function returns true.

    “run in front end only” does the exact opposite – only fetches and executes the snippet when the is_admin() function returns false.

    A snippet set to “run everywhere” will always be fetched and executed regardless of what the is_admin() function returns.

    It’s usually not necessary to change the scope from “run everywhere”, and it’s certainly possible to check the value of is_admin() within the code itself.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Deciding where to run snippet’ is closed to new replies.