pass datetime using wp_localize_script to frontend from settings page

Question

Is possible to use the wp_localize_script fom the front-end? I’vecreated a JS countdown timer that will take an input data from a settings page fom backend. The script that will display the countdown is enqueued only on fornt-end and will be visible only if a checkbox is checked. If I use the get_option() function and then pass the result to the wp_localize script, will it work as expected? What’s the best way to proceed?

0
, sialfa 2 years 2020-01-14T08:38:51-05:00 0 Answers 73 views 0

Leave an answer

Browse
Browse