Support

Account

Home Forums Backend Issues (wp-admin) Load_value and saving to database

Solving

Load_value and saving to database

  • Im using load_value to get data from an API.
    That works fine what i want to do next is to send data to API upon save aswell however the wordpress database doesnt seem to save the data from the same input field. should i use update_value or what?

  • Hi @christian.widlund@gmail.com

    Perhaps you could include some code that you are using and also be more specific about what you are trying to achieve.

    P.S. when you say load_value, what do you mean?

    Thanks
    E

  • im using add_filter('acf/load_value/name=my_select', 'my_acf_load_value', 10, 3);
    to fill out some input fields on certain posts.
    this all works well to fill out the input fields with what i get from the api.
    The problem is when i change them and hit update they don’t seem to get saved in the wp db.
    it also doesnt seem to be sent to

    add_action('save_post', 'function');
    add_action('update_post', 'function');
  • Hi @christian.widlund@gmail.com

    What do you mean by “The problem is when i change them and hit update they don’t seem to get saved in the wp db.”

    When you change what? The field option textarea or the code within your filter?

    The filter is not able to save the data. It will run every time the field is loaded, not saved.

  • when i change the data inside the input field.
    when using load_value do i change the properties of the input field?

  • Hi @christian.widlund@gmail.com

    When you use the load_field filter, you will be modifying the data of the field on the fly when the field is rendered.

    Perhaps your data is saving, but you are overriding it in your filter?

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Load_value and saving to database’ is closed to new replies.