Home › Forums › General Issues › How to use the taxonomy/result filter? › Reply To: How to use the taxonomy/result filter?
For what it’s worth I found a workaround for anybody needing similar functionality. What I did was use the update_value filter to create custom meta data based on taxonomy term names. Here is a snippet of the code:
function custom_acf_values( $value, $post_id, $field ) {
// Set authors
if( $field['name'] == 'authors' && $value != '' ) :
$names = '';
$authors = $value;
if( $authors ) :
foreach( $authors as $author ) {
$sep = '; ';
if( $author == end( $value ) ) {
$sep = '';
}
$author = get_term( $author, 'authors' );
$name = $author->name . $sep;
$names .= $name;
}
endif;
update_post_meta( $post_id, 'poster-authors', $names );
endif;
}
add_filter('acf/update_value', 'custom_acf_values', 10, 3);
However, I am still interested in learning more about the filter I mentioned in OP.
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.