Support

Account

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

  • If it were me I would alter the function you posted to set up the field group args, then add a call to a filter to allow modification in the child themes functions.php file and then call acf_add_local_field_group();

    
    function () {
      $args = array(/*field group settings*/);
      apply_filters('my-theme-name-my-field-group-name', $args);
      acf_add_local_field_group($args);
    }
    

    then in the child them you can add

    
    add_filter('my-theme-name-my-field-group-name', 'child_theme_function', 10, 1);
    function child_theme_function($args) {
       // modify args
       return $args;
    }