Home › Forums › General Issues › Saving post content into product meta field › Reply To: Saving post content into product meta field
Here’s some directions for ya
1) the function get_the_term_list() returns the HTML https://codex.wordpress.org/Function_Reference/get_the_term_list. the function you are looking for is get_the_terms() https://developer.wordpress.org/reference/functions/get_the_terms/
2) when you initialize the WP_Query, take a look at what types of parameter you should pass to search in the category https://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters. ‘category__in’ requires an array of term ids. And ‘cat’ requires a term id.
3) use get_the_content() to retrieve the post content https://developer.wordpress.org/reference/functions/get_the_content/
4) to update repeater field, you can either use update_field or update_sub_field functions.
https://www.advancedcustomfields.com/resources/update_field/
https://www.advancedcustomfields.com/resources/update_sub_field/
these should get you going with what you are trying to do.
Cheers!
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.