Home › Forums › Backend Issues (wp-admin) › acf_render_field_setting() position in form › Reply To: acf_render_field_setting() position in form
Yes, this is true. The generic acf/render_field_settings hook is only fired at the beginning. I know that the developer at least knows about this because I’ve brought it up on github, but I do not know the status of this. I’ve worked out my own solution. I would suggest opening a support ticket https://support.advancedcustomfields.com/new-ticket/
I solve it by adding the action to every field type for now…. and this is also a little dependent on the version of ACF, 5.5.* stored the fields a bit differently. this is the relevant code from one of my plugins.
$function = 'name of function to call';
$priority = 1; // change to 20 for bottom of settings
$acf_version = acf_get_setting('version');
$sections = acf_get_field_types();
if (version_compare($acf_version, '5.5.0', '<') ||
version_compare($acf_version, '5.6.0', '>=')) {
foreach ($sections as $section) {
foreach ($section as $type => $label) {
add_action('acf/render_field_settings/type='.$type, $function, $priority);
}
}
} else {
// >= 5.5.0 || < 5.6.0
foreach ($sections as $type => $settings) {
add_action('acf/render_field_settings/type='.$type, , $function, $priority);
}
}
EDIT: You’ll want to do this on ‘acf/init’ or on ‘init’ with a high priority
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.