Support

Account

Home Forums Front-end Issues Select2 not pulling saved values on MultiSite Reply To: Select2 not pulling saved values on MultiSite

  • This is the closest I’ve found to what I’ve been having happen.
    I’ve got two field groups that when they are both used on the same page, one fails to load its values in the editor.
    One is just a handful of fields that are used for a header on certain pages.
    The other is a system where I have records of people created on one site in the multisite that I can call and display on pages on other sites.
    Recently, when both of those field groups are used on the same page, the simple one fails. It seems to be because it is looking for the content on the other site where the people are called.
    to handle the switch to the other site to call up the people, I use this filter:

    function mhsl_acf_prepare_who( $field ) {
    	$this_site_id = get_current_blog_id();
    	switch_to_blog(5); // 5 is the id of the site where the people are stored
        return $field;
    	switch_to_blog($this_site_id); 
    }
    add_filter('acf/prepare_field/name=who', 'mhsl_acf_prepare_who', 99, 1); // I've tried various priority numbers

    I tried filtering the other fields to a higher priority too. No change.