owlwatch / acf-multisite-options

Allow Advanced Custom Fields Pro Options pages to be used in Network Admin
39 stars 12 forks source link

How do I retrieve the values? #5

Open wonkeythemonkey opened 5 years ago

wonkeythemonkey commented 5 years ago

I see that the values are stored in the sitemeta table, but how do I access them by name? I tried get_field($fieldName, 'option'), but I got no result.

nehagrover027 commented 5 years ago

Hi,

I've the same question. Can't retrieve values. I've tried various codes like: get_field($fieldName, 'option') echo get_site_option('optionname'); get_network_option(get_current_network_id(), 'top_header_color');

but none of its is working. Please help.!

tyler-paulson commented 4 years ago

I was having the same issue as well! I finally figured out that you need to use the page_id you used when you instantiated the options page, so if you used the value in the readme, it'll look something like this:

get_field('your_field_name', 'acf_network_options');