Forked from scottopolis/wp-api-custom-taxonomies.php
Created
October 28, 2015 05:39
-
-
Save CoachBirgit/14149ada469c0a27da22 to your computer and use it in GitHub Desktop.
Add custom taxonomies to the WP-API
This file contains hidden or 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
<?php | |
function ms_add_tax_to_api() { | |
$taxonomies = get_taxonomies( '', 'objects' ); | |
foreach( $taxonomies as $taxonomy ) { | |
$taxonomy->show_in_rest = true; | |
} | |
} | |
add_action( 'init', 'ms_add_tax_to_api', 30 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment