Created
August 27, 2020 01:12
-
-
Save BruceMcKinnon/e453dbe5cb6cf31fdfea6c4bf6505549 to your computer and use it in GitHub Desktop.
Add taxonomies to Content Blocks (Custom Post Widgets)
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
// | |
// Add Category support to the Custom Post Widget - https://wordpress.org/plugins/custom-post-widget/ | |
// NB - Must set the priority to a high number | |
// | |
add_action( 'init', 'add_content_block_taxonomies', 99 ); | |
function add_content_block_taxonomies() { | |
register_taxonomy_for_object_type( 'category', 'content_block' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment