I have a plugin that inject some HTML into a post to dis开发者_Go百科play 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.
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!
精彩评论