Home › Forums › Add-ons › Flexible Content Field › Possible to get excerpt from sub_field? › Reply To: Possible to get excerpt from sub_field?
It should be as simple as this.
function custom_sub_field_excerpt($field) {
$text = get_sub_field($field);
// the rest of your code
}
You also don’t need to use global $post;
in your case since your not using it for anything and ACF automatically does this if you don’t supply a post ID when getting the value of a field.
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.