Support

Account

Home Forums Bug Reports Errors in Post Object field ( ACF 5.7.2 ) Reply To: Errors in Post Object field ( ACF 5.7.2 )

  • Hi @howdy_mcgee

    Thanks for the bug report,
    Elliot here – ACF dev​​​.

    Sorry about this issue, it is easily solved.
    Can you please edit the ‘api-terms.php’ file in question and change the acf_get_taxonomy_labels() function to:

    
    function acf_get_taxonomy_labels( $taxonomies = array() ) {
    	
    	// default
    	if( empty($taxonomies) ) {
    		$taxonomies = acf_get_taxonomies();
    	}
    	
    	// vars
    	$ref = array();
    	$data = array();
    	
    	// loop
    	foreach( $taxonomies as $taxonomy ) {
    		
    		// vars
    		$object = get_taxonomy( $taxonomy );
    		$label = $object->labels->singular_name;
    		
    		// append
    		$data[ $taxonomy ] = $label;
    		
    		// increase counter
    		if( !isset($ref[ $label ]) ) {
    			$ref[ $label ] = 0;
    		}
    		$ref[ $label ]++;
    	}
    	
    	// show taxonomy name next to label for shared labels
    	foreach( $data as $taxonomy => $label ) {
    		if( $ref[$label] > 1 ) {
    			$data[ $taxonomy ] .= ' (' . $taxonomy . ')';
    		}
    	}
    	
    	// return
    	return $data;
    }