Home › Forums › Bug Reports › Slugbug? › Reply To: Slugbug?
That is just the code I used here to describe the problem. My actual code looks like this:
if(function_exists("register_field_group")) {
register_field_group(array (
'id' => 'acf_webinar',
'title' => 'Webinar',
'fields' => array (
array (
'key' => 'field_525fffb950527',
'label' => 'Webinar code',
'name' => 'webinar_code',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'course',
'order_no' => 0,
'group_no' => 0,
),
array (
'param' => 'page_type',
'operator' => '==',
'value' => 'child',
'order_no' => 1,
'group_no' => 0,
),
array (
'param' => 'page_parent',
'operator' => '==',
'value' => $this->options['webinar_parent'],
'order_no' => 2,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'side',
'layout' => 'default',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}
Now, when I use either get_field( ‘webinar_code’ ) or the_field( ‘webinar_code’ ), it returns false even though a value is stored.
The get_field() function doesn’t work anywhere, I tried it in several files.
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.