Created
April 16, 2014 20:11
-
-
Save j-gardner/10928035 to your computer and use it in GitHub Desktop.
Add post tags support to a custom post type (in this case "portfolio")
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 | |
/** | |
* Adds Post Tag support to a custom post type. | |
* | |
* This code is set to work with Arconix Portfolio, however | |
* the code should work with any of my plugins, simply | |
* change the 1st filter argument to match, i.e. | |
* 'arconix_testimonials_defaults' as I structure my | |
* defaults pretty much the same across all my plugins | |
*/ | |
// Place the code below in your theme's functions.php file | |
function arconix_add_tag_support( $defaults ) { | |
$defaults['post_type']['args']['taxonomies'] = array( 'post_tag' ); | |
return $defaults; | |
} | |
add_filter( 'arconix_portfolio_defaults', 'arconix_add_tag_support' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment