Support

Account

Home Forums Backend Issues (wp-admin) Ajax the ACF way Reply To: Ajax the ACF way

  • I was adding the hook inside the custom field class __construct:

    class acf_field_my_custom_field extends acf_field {
    
    //ajax hooks here
    
    }
    

    That’s in the acf-my_custom_field-v5 file.

    I couldn’t get it to work there, so I added out side the class in the main plugin file, and it worked. However that creates another problem… I don’t have access to the data inside the class my_custom_field.