Get object in Advanced link

[ad_1]

Hello,

Thanks for the feedback!

There is no need for additional filter here. You can retrieve the unformatted value of any ACF Field using by passing a parameter in your get_field(). See documentation.

For example, here the formatted value of the Advanced Link:

get_field('my_advanced_link', 270);
array(
    "title"  => "Text",
    "url"    => "https://www.domain.com/category-1",
    "target" => "0",
)

Here is the unformatted value of the Advanced Link. Note the false at the end:

get_field('my_advanced_link', 270, false);
array(
    "type"   => "term",
    "term"   => "1",
    "title"  => "Text",
    "target" => "0",
)

With the term id you can retrieve the Term Object using get_term() (See documentation), and then construct your thumbnail.

Hope it helps!

Have a nice day!

Regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer