Created
June 11, 2015 21:40
-
-
Save tripflex/b61c1cf65103daf7cdca to your computer and use it in GitHub Desktop.
WordPress wp_get_object_terms convert $taxonomies SQL-formatted (comma-separated and quoted) to array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Because get_object_terms filter was not included until WP 4.2+ we have to use wp_get_object_terms for backwards compatibility. | |
// Unfortunately this means taxonomies are passed like this: ( 'resume_category', 'resume_skill' ), so we have to remove the quotes, | |
// and then use explode to convert it into an array of taxonomies. | |
$tax_array = explode( ", ", str_replace( "'", "", $taxonomies ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment