Alex Angas
Alex Angas

Reputation: 60037

Retrieving the tags for a post from a Wordpress plugin

I'm new to Wordpress plugins, and editing someone else's to add functionality. I need to retrieve the tags for a particular post.

The get post function is already in use inside the plugin and returns category information. Unfortunately nothing is returned for tags.

The get the tags function appears to be most appropriate but it only runs inside the Wordpress loop. My understanding is that plugins run outside the loop.

I haven't found anything else in the API reference.

How is it possible to retrieve the tags for a post?

Upvotes: 0

Views: 521

Answers (2)

Sudar
Sudar

Reputation: 20000

Try this

get_the_tags($post->ID)

Upvotes: 2

Lista
Lista

Reputation: 2246

http://wordpress.org/support/topic/191245

A couple of solutions behind that link.

Upvotes: 0

Related Questions