Home › Forums › Front-end Issues › wp localize script and jquery › Reply To: wp localize script and jquery
Hello,
thanks for answer,
I try now:
function pw_load_scripts() {
wp_register_script('pw-script', get_template_directory_uri() . '/assets/public/js/custom_filed.js', array('jquery'));
wp_localize_script('pw-script', 'pw_php_vars', array(
'custom_filed' => custom_filed
)
);
wp_enqueue_script('pw-script');
}
add_action('wp_enqueue_scripts', 'pw_load_scripts');
and still getting text custom_field instead of value. Is maybe problem with jquery?
I try with append and html
Thanks for help,
A
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.