Support

Account

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.