Return to Snippet

Revision: 78475
at November 20, 2019 22:38 by ginoplusio


Initial Code
$articles_in_post_type = get_posts( array(
    'fields' => 'ids',
    'post_type' => 'post',
    'posts_per_page' => -1,
));
$tags = wp_get_object_terms( $articles_in_post_type, 'post_tag', array('ids') );

Initial URL
https://www.barattalo.it/coding/two-post-types-share-the-same-taxonomy-in-wordpress/

Initial Description
Extract all the tags (shared between two post types) used with a specific post type

Initial Title
How to extract the tags shared between two different post types in Wordpress

Initial Tags
wordpress

Initial Language
PHP