Forked from scottopolis/wp-api-custom-taxonomies.php
Created
October 29, 2015 09:29
-
-
Save quasel/2ddf5fdb8f95ccfe5898 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