Support

Account

Home Forums Backend Issues (wp-admin) Adding Rules to field group with php Reply To: Adding Rules to field group with php

  • So I tried this and got nothing.

    
    function add_location() {
    
    	$field_group = apply_filters( 'acf/load_field_group', $field_group );
    
    	if ($field_group['key'] = 'group_5fc70b388fe13')
    	{
    			array_push($field_group['location'],
    				array(
    					array (
    						'param' => 'post_type',
    						'operator' => '==',
    						'value' => 'registration',
    					),
    				)
    			);
    		return $field_group;
    	}	
    }
    add_action('init', 'add_location');