Created
October 27, 2015 22:27
-
-
Save scottopolis/997b86d8afa7825bc942 to your computer and use it in GitHub Desktop.
Add custom taxonomies to the WP-API
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
<?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
it works ;) thanks