<?php
/**
* Remove taxonomies that you probably won't need, and take forever to load all the terms in ACF taxonomy field.
*
* @version 1.0.0
* @author @JiveDig
* @uses Advanced Custom Fields
*
* @param array $taxonomies The existing taxonomies.
* @param array $args An array of args used in the get_taxonomies() function.
*
* @return array The modified array of taxonomy names.
*/
add_filter( 'acf/get_taxonomies', function( $taxonomies, $args ) {
// Array of taxonomies to remove.
$remove = array(
'post_tag',
'post_format',
'yst_prominent_words',
);
// Loop through em.
foreach ( $remove as $taxonomy ) {
// Remove them from the options.
$taxonomies = array_diff( $taxonomies, array( $taxonomy ) );
}
return $taxonomies;
}, 10, 2 );