Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery.noConflict();
- jQuery(document).ready(function($) {
- var foo1 = acf.get('the_description');
- console.log(foo1);
- });
- add_action( 'wp_enqueue_scripts', 'my_scripts_method' );
- function my_scripts_method(){
- wp_register_script( 'acf-input', acf_get_dir( "assets/js/acf-input.min.js" ), array('jquery'), acf_get_setting('version'), true );
- wp_enqueue_script( 'custom', get_template_directory_uri() . '/js/custom.js', array('jquery','acf-input'),null,true);
- });
- acf.add_action('ready', function( $el ){
- var foo2 = acf.get('the_description_natural');
- console.log(foo2);
- });
- acf.getField('the_description'); // не acf.get()
- wp_enqueue_script( 'custom', get_template_directory_uri() . '/js/custom.js', array('jquery','acf-input'),null,true);
- wp_localize_script('custom', 'custom_vars', array(
- 'natural' => get_field("the_description_natural",$post_id)
- )
- );
- jQuery.noConflict();
- jQuery(document).ready(function($) {
- console.log(custom_vars.natural));
- });
Add Comment
Please, Sign In to add comment