From fe2cbde1c3924e5800c2d5d279ff24b8aff59ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ribari=C4=87?= Date: Thu, 18 Feb 2021 08:18:25 +0100 Subject: [PATCH] Add documentation for getting term fields --- includes/api/api-template.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/api/api-template.php b/includes/api/api-template.php index 7a4dea7f..a7de7dea 100644 --- a/includes/api/api-template.php +++ b/includes/api/api-template.php @@ -7,6 +7,8 @@ * There is a 3rd parameter to turn on/off formating. This means that an image field will not use * its 'return option' to format the value but return only what was saved in the database * +* When getting fields for a specific taxonomy term, make $post_id a WP_Term object. +* * @type function * @since 3.6 * @date 29/01/13 @@ -254,6 +256,8 @@ function acf_maybe_get_sub_field( $selectors, $post_id = false, $strict = true ) * This function will return an array containing all the custom field values for a specific post_id. * The function is not very elegant and wastes a lot of PHP memory / SQL queries if you are not using all the values. * +* When getting fields for a specific taxonomy term, make $post_id a WP_Term object. +* * @type function * @since 3.6 * @date 29/01/13 @@ -294,6 +298,8 @@ function get_fields( $post_id = false, $format_value = true ) { * This function will return an array containing all the custom field objects for a specific post_id. * The function is not very elegant and wastes a lot of PHP memory / SQL queries if you are not using all the fields / values. * +* When getting fields for a specific taxonomy term, make $post_id a WP_Term object. +* * @type function * @since 3.6 * @date 29/01/13