您只需在的第二个参数中将所需的post类型作为数组传递register_taxonomy
函数调用:
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\' );
}