[wp-hackers] automatically trackbacking a url if post is in given category

Shelley Powers burningbird at gmail.com
Wed Jul 14 14:17:16 UTC 2004


Tara

You can alter the table with the following, in MySQL:

      alter table wp_categories add category_trackback text;

Or you can do this with phpmyadmin if you have access to this -- go to
table wp_categories Structure tab, and look for "Add new field"

For the plugin part, create the function that makes the ping (hint,
look in functions.php in the generic_ping function for some good
how-to stuff) in wp-includes. At the bottom of the new function file, 
you'll want to capture the following action:

add_action('publish_post','whatever you call your funciton');

You have to pass a post id with this function and return it. Just call
it $post_id.

Following is the source code for one of my plugins that captures the
same action:

http://weblog.burningbird.net/wordpress_docs//__filesource/fsource_modified_wordpress__rdfwp-contentpluginsgen-static-main.php.html

Have fun

Shelley

On Wed, 14 Jul 2004 07:50:57 +0200, Tara Star
<tellme at climbtothestars.org> wrote:
> Matt Mullenweg wrote:
> 
> > Tara Star wrote:
> >
> >> e.g., each time I post something to my "Music" category, I would like
> >> WP to trackback http://topicexchange.com/t/music/ -- can that be done?
> >> Does a plugin/hack for this exist? (otherwise I'll end up doing it if
> >> nobody does ;-))
> >
> >
> > Suggested implementation:
> >
> > Addtional field in category table (like category_trackback) with a
> > newline separated list of URIs to ping when a post is made to a
> > category. Then use the publish/edit action hooks to do the proper
> > pinging when a post is published. Already pinged URIs should be saved in
> > the post level field for this.
> >
> 
> Thanks for the suggestion. Does that mean making a plugin out of it?
> Would anybody be willing to help me out with this? (I'm not sure how to
> go about table modifications and hooks...)
> 
> Steph
> --
> http://climbtothestars.org/
> 
> 
> 
> _______________________________________________
> hackers mailing list
> hackers at wordpress.org
> http://wordpress.org/mailman/listinfo/hackers_wordpress.org
>



More information about the hackers mailing list