[wp-hackers] how to append some tag to post automatically, when it is published?

Otto otto at ottodestruct.com
Thu Sep 10 14:23:12 UTC 2009


wp_add_post_tags($post_id = 0, $tags = '')

Example:
wp_add_post_tags(12345, 'video, another-tag, whatever');

-Otto



On Thu, Sep 10, 2009 at 8:17 AM, Konrad Karpieszuk
<kkarpieszuk at gmail.com> wrote:
> hi :)
> Sometimes on my blog someone will publish post with Custom field name =
> "video" and value = [url to video at YT]
>
> I want that thos post will have added automatically blog tag 'video'
>
> How to do this?
>
> I just know that i need to add action hook for 'publish_post'. but what
> should be in function? does wp has some function to add tag to post (i
> belive yes, but i don't know which one)?
>
> --
> (en) regards / (pl) pozdrawiam
> Konrad Karpieszuk
> http://konradjestwrwandzie.wordpress.com/
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list