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 our Themes & Plugins

Trusted by 1000+ Websites

Become a member to use our themes & plugins for an unlimited number of sites. Free and Premium options!

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!