Support

Account

Forum Replies Created

  • 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.

  • I added it like this and so far it seems to have fixed the problem.

    		// ensure is_plugin_active() exists (not on frontend)
    		if( !function_exists('is_plugin_active') ) {
    			
    			include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    			
    		}		
    		
    		// bail early if not a plugin (included in theme)
    		if( !is_plugin_active($basename) ) {
    
    			return $transient;
    			
    		}
    		
    
Viewing 4 posts - 1 through 4 (of 4 total)