Home › Forums › General Issues › How do you add [ get_comments_number() ] function in a custom field? › Reply To: How do you add [ get_comments_number() ] function in a custom field?
this is explained on the page I linked to above http://www.advancedcustomfields.com/resources/acfformat_value/
$value = the value which was loaded from the database
$post_id = the post ID from which the value was loaded
$field = An array containing all the field settings for the field which was used to upload the attachment
Let’s say that you wanted to do sortcoded on all acf text fields
add_flter('acf/format_value/type=text', 'text_field_do_shortcodes', 10, 3);
function text_field_do_shortcodes($value, $post_id, $field) {
return do_shortcode($value);
}
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.