All what you need to do is just pass required post types as array in the second parameter for register_taxonomy
function call:
add_action( 'init', 'wpse8170_init' );
function wpse8170_init() {
register_taxonomy( 'my-taxonomy', array( 'post' ), array(
...
) );
// or call this function if your taxonomy is already registered
register_taxonomy_for_object_type( 'my-taxonomy', 'page' );
}
Related Posts:
- Query Posts by Custom Field ‘Price’
- remove custom taxonomy metabox form custom post type
- How to Build a Movie Library in WordPress 3.x
- Show Heirachy of categories in WP Download Monitor
- Getting a List of Categories for Use in a Plugin?
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- WordPress category add image field
- Where (or when) should I register a new taxonomy?
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- How to set taxonomy in custom plugin?
- WP_Terms_List_Table Quick Edit not working
- Ordering taxonomies by rank
- Redirect to another page using contact form 7? [closed]
- Default taxonomy template in plugin, override in theme
- Best/Correct way to add an option to a category
- How to add category and subcategory in WordPress custom code?
- How can i listing current category and Featured Category post list?
- How to get Recent Post From Each Category with Thumbnail?
- Add a new category for posts
- Need to edit author permissions | custom taxonomy
- How to overwrite the category template in a plugin
- Visual composer custom element error
- Display posts by alphabetical order
- How to display the category name in the tab and post inside the tab in WordPress?
- Getting the same post on my related post
- Cannot view Custom Post Type no matter what I try
- Taxonomy Category Icon on index page
- View more posts of a sub-category
- How to insert category name above post title in a featured pages plugin?
- trying to create simple plugin to filter categories from all authors
- Filter EVERY category link with my plugin
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- wp_insert_post_data filter to set category
- Create WordPress category dynamically
- Need a Category List for the category slug
- How to Display News in a Timeline with Headline, Category, and Time?
- How to create custom embed block in gutenberg wordpress
- The Point of Using apply_filters()
- How do I turn a custom post type into a plugin?
- Plugin exceeds memory limit
- How can I implement a notification system in wordpress?
- Redirect to a welcome page after updating plugin
- Find the URL of the current plugin directory
- How to automate wordpress plugin activate and deactivate by php logic?
- Custom plugins/Manipulated plugins: Always a terrible idea to inherit these types of WP sites that discourage updates? [closed]
- Where does WordPress register default scripts like jQuery?
- Minimum PHP Required for WordPress
- Adding content before the loop in category pages
- How to get variables from fucntion.php to my plugin files
- admin_notices hook show message all admin pages after plugin activate
- Accessing GET variable named ‘error’
- Adding Attachment Display Settings in custom media frame
- Set user ID at time of wp_create_user
- How to include code into functions.php file via a plugin
- building plugin and it is displaying above plugins page
- like to keep reading plugin
- Check if email address exists front end with AJAX in a plugin
- Avoiding Duplicate function names in Post Loop (WP_Footer script)
- Custom Taxonomy Tag Search
- Default Plugin Settings Not Writing to Database
- Add custom taxonomy to title tag [closed]
- add action for displaying posts using a shortcode
- Possible to replicate economist.com’s debate section in wordpress? [closed]
- How do I write into a file (css)
- WP Plugin Developers – Accessing my wordpress site [closed]
- How to make a custom field as an editor in wordpress?
- WP_Query ordering numbers as letters
- WordPress Automatic Plugin Update Renames Plugin Directory
- How can sanitize $_FILES[‘haq_slider’] field
- Why is an action callback function from an instance of a class always invoking the same function from an instance?
- Write to / remove from default .htaccess file from plugin?
- ‘wp_login’ action hook not working with wp-login.php file
- Is it possible to enqueue CSS files from plugin before theme’s CSS files?
- Update Option Error: Notice: Undefined index
- Why this global array is returning NULL from a callback function
- Demystifying and understanding shortcode nomenclature
- How to define WordPress plugin shortcode globally for multisite?
- download_url() appears as grey icons
- Global matrix for shortcodes/content for every page
- Plugin not appearing after uploading it via FTP
- How to add class in plugin only for network site?
- load_theme_textdomain path
- how to Include json manifest file in wp plugin
- Plugin Development sqlite or WordPress’ database
- Is there any way to get all the name or slug of template parts used in a page?
- Dynamic CSS Vs Inline Issues in Code any Way around in a WordPress Themes?
- Is license need for free wordpress plugin
- How to make Http Request to a php file present in plugin directory of wordpress
- Create a custom page template inside my wordpress plugin
- Retrieving plugin options value saved through setting
- Custom Post Type Plugin not loading category template and loading 404 instead
- Best way to hook a custom url?
- How to cancel WordPress’ action/filter when using OOP with anonymous callback
- Read text defined under __()
- How to change commenter links to /user/user_id?
- Display content from custom post type if match to main post category
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Execute a plugin only on post pages
- What is the best way to mimic a search query within a plugin
- Next and/or previous post content