Skip to content

Changed wp_get_the_category() to wp_get_post_categories() #115

Open
davpsh wants to merge 1 commit intoMedium:masterfrom
davpsh:issue-#114
Open

Changed wp_get_the_category() to wp_get_post_categories() #115
davpsh wants to merge 1 commit intoMedium:masterfrom
davpsh:issue-#114

Conversation

@davpsh
Copy link

@davpsh davpsh commented Aug 25, 2016

#114 Added comment for wp_get_post_categories()

Added comment for wp_get_post_categories()
Copy link

@lacqui lacqui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done some local testing and this appears to work for me.

}
$tags = array_values(array_unique(array_merge($cats, $tags)));
$args = array('fields' => 'names'); // @see wp_get_post_categories() $args ref to wp_get_object_terms()
$categories_name = wp_get_post_categories($post->ID, $args);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$category_names, or just $cats

$cats[] = $category->name;
}
$tags = array_values(array_unique(array_merge($cats, $tags)));
$args = array('fields' => 'names'); // @see wp_get_post_categories() $args ref to wp_get_object_terms()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double quotes, as the rest of this plugin please, even though it's not WP-standard.

@razvanilin
Copy link

Did some testing and it works for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants