Home › Forums › Backend Issues (wp-admin) › Update fields in multisite 503 error › Reply To: Update fields in multisite 503 error
Because you are switching to blog 1 and then trying to update the field there, this is causing your first filter to run, the call to your first filter is then causing your second filter to run creating an infinite loop.
In each filter you must have the filter remove itself before trying to update the other field and then re-add the filter when your done. This must be done in both filters
example:
add_filter('acf/update_value/key=field_5edd04a1cc440', '_acf_update_value_key_field_5edd04a1cc440', 11, 3);
function _acf_update_value_key_field_5edd04a1cc440($post_value, $post_id, $field) {
// remove self
remove_filter('acf/update_value/key=field_5edd04a1cc440', '_acf_update_value_key_field_5edd04a1cc440', 11);
// preform filter operation
// re-add self
add_filter('acf/update_value/key=field_5edd04a1cc440', '_acf_update_value_key_field_5edd04a1cc440', 11, 3);
return $post_value;
}
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.