Support

Account

Home Forums General Issues Custom field setting of Relationship type not showing any values Reply To: Custom field setting of Relationship type not showing any values

  • In the meanwhile, I will try to dynamically populate the fields choices array and see if that works.

    While this didn’t solve my original problem of the choices/pages not showing up in a ‘Relationship’ type field, the alternative approach described above worked just fine for what I was trying to achieve:

    
        acf_render_field_setting( $field, array(
    		'label'			=> __('Hide on Pages', 'jdmn'),
    		'instructions'	=> __('Hide this field on the following pages.', 'jdmn'),
    		'name'			=> 'hide_on_pages',
    		'type'          => 'select',
            'choices'       => (function(){
                $array = array();
                $pages = get_pages();
                foreach( $pages as $page ) {
                    $array[$page->ID] = $page->post_title;
                }
                return $array;
            })(),
            'default_value' => null,
            'allow_null'    => 1,
            'multiple'      => 1,
            'ui'            => 1,
    	), true);