Support

Account

Home Forums Backend Issues (wp-admin) Overwrite acf_add_local_field_group Reply To: Overwrite acf_add_local_field_group

  • Sorry John, it is PHP, in the parent theme there’s a file which is /acf-fields/team.php and in there is:

    add_action( 'acf/include_fields', function() {
    	if ( ! function_exists( 'acf_add_local_field_group' ) ) {
    		return;
    	}
    
    	acf_add_local_field_group( array(
    	'key' => 'group_652407356c71f',
    	'title' => 'Practice Team',
    	'fields' => array(
    		-- ALL THE FIELDS HERE --
    	),
    	'location' => array(
    		array(
    			array(
    				'param' => 'page',
    				'operator' => '==',
    				'value' => '247',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'acf_after_title',
    	'style' => 'seamless',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => array(
    		0 => 'the_content',
    	),
    	'active' => true,
    	'description' => '',
    	'show_in_rest' => 0,
    ) );
    } );

    So this is on many sites but on this 1 particular site I need to be able to just add an additional image field to one of my repeaters, so was hoping to overwrite this function in the child themes functions.php without needing to copy the file.
    Thanks.