views:

69

answers:

1

Is it ok to ask question about Wordpress development here? Any way i have a plugin that inject some HTML into a post to display some information from our site alternativeto.net. The plugin is located here:

http://wordpress.org/extend/plugins/alternativeto/

The problem is that our content is added to the post via javascript when the post is displayed so we always get "fresh" data. Therefore Wordpress does not send a pingback to the urls that the plugin will add to the post and the author do not get a link back from us via our pingback system.

I need a way to look into to the content of the post that is posted, find our shortcode, translate that shortcode to a URL to us and add that url to the list of urls to ping.

Anyone have any suggestions on how to this? Im not that experience with either PHP or Wordpress so please be gentle :)

A: 

If all you need todo is parse the contents of a post for a short tag and replace it with another value when the post is rendered then check out the "the_content" filter hook: codex.wordpress.org/Plugin_API

Also take a look at the source code for this plugin. It looks though the contents of a post and finds post IDs in two sets of square brackets (like [[123]]) and replaces it with the content of that post... which sounds along the same lines as what you are aiming for (well more or less)

Hope that's some help!

Cheers,

Tom

Hi there! Thanks for your answer. The problem is that i just need to find the shortcode in the content to be able to get a url that i can add to the list of urls to send a pingback to. So it's basically that i am asking :)
Stuck