AdvancedCustomFields / AdvancedCustomFields/acf
Create filter to change $extra var
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
I need change slug term before insert into db, but if I use the action ajax_add_term from ACF, I can't to do it.
I thing this soluction, We need create a filter hook to change var before save.
Could be like that:
$extra['parent'] = (int) $args['term_parent'];
$extra = apply_filters('acf/fields/taxonomy/add_term/extra', $extra, $args);
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 in includes/fields/class-acf-field-taxonomy.php around line 902 and trace the ajax_add_term path. Review the proposed acf/fields/taxonomy/add_term/extra filter and verify that it can change $extra before the term is inserted into the database. Done means the filter is available at that point and supports changing the requested term data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100