Introduction

One can define custom field formatters using the df_acf_formatter_callbacks filter. This filter takes an array array as an argument. Each array item is a key, value pair consisting of callback name and callback function (anonymous function)

Code

A sample implementation below

In the above code, we register a filter called registeracfformatters which defines a custom field formatter called my-post-content which returns the post_content on the current single post item.

Get access to all our themes and plugins

Trusted by over 1000+ websites

Become a member to use our themes & plugins for an unlimited number of sites. No restrictions!

30-day money-back guarantee.

Not satisfied? Your money back, no questions asked.

Subscribe

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!