Support

Account

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!