AdvancedCustomFields / AdvancedCustomFields/acf
Custom tabs settings - Error with key "prefix"
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Hello everyone :)
I'm actually working on add a custom tab for settings. However i reach an issue.
First I add my custom tab with acf/field_group/additional_group_settings_tabs :
add_filter("acf/field_group/additional_group_settings_tabs", function ($tabs) {
$tabs["tab-key"] = "Tab key";
return $tabs;
});
Then I add field for this custom tab with acf/field_group/render_group_settings_tab/$tab-key :
add_action('acf/field_group/render_group_settings_tab/tab-key', 'render_custom_field_settings_tab');
function render_custom_field_settings_tab($field)
{
acf_render_field_setting(
$field,
[
"label" => "Label",
"name" => "name_field",
"aria-label" => "",
"type" => "text",
"instructions" => "Instructions.",
"required" => 1,
],
true
);
}
Issue
Warning : Undefined array key "prefix" in "plugins/advanced-custom-fields-pro/includes/acf-field-functions.php" on line 936.
Environment
WordPress : 6.2.2
PHP : 8.1.9
ACF Pro : 6.1.6
If you need any other informations about my environment, you could ask :)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at plugins/advanced-custom-fields-pro/includes/acf-field-functions.php line 936 and reproduce the warning using the additional_group_settings_tabs and render_group_settings_tab hooks shown in the issue. Trace which field data lacks the prefix key, then verify that the custom settings tab renders without the warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100