From d55e27fbd415bf75367103117b6b179277ed3f64 Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Wed, 9 Nov 2016 18:05:45 -0500 Subject: [PATCH] copy tags from all supported post types --- class-copy-post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class-copy-post.php b/class-copy-post.php index cfe2075..bff1bcf 100644 --- a/class-copy-post.php +++ b/class-copy-post.php @@ -110,7 +110,7 @@ function add_ajax_get_post_endpoint() { $post = get_post( $post_id ); - if ( 'post' == $post->post_type ) { + if ( in_array( $post->post_type, get_post_types_by_support( 'writing-helper' ), true ) ) { $post->post_tags = implode( ', ', (array) $wpdb->get_col( $wpdb->prepare( "SELECT slug FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} AS tt ON tt.term_id = t.term_id INNER JOIN {$wpdb->term_relationships} AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ( 'post_tag' ) AND tr.object_id = %d", $post_id ) ) ); $post->post_categories = get_the_category( $post_id ); }