• I’ve written a filter plugin that is called with the “the_content” hook. It looks to see if is_rss(), and if so, mangles the content in a particular way.

    I need to get at the post’s details–particularly, the ID and the permalink–from inside my plugin. I don’t want to display them, I want to get them as variables. So the_id() and the_permalink() aren’t what I’m after.

    Are there methods to call on $post or something?

Viewing 1 replies (of 1 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    For the permalink, get_permalink() will return the permalink string.

    For the id, the $id variable is global, so just declare it as such in your function: global $id; Then it’ll have the current id number.

Viewing 1 replies (of 1 total)
  • The topic ‘getting ID and permalink inside the_content plugin’ is closed to new replies.