• I am writing a script to automatically add a tag to a post by running it from the single post page itself. That is, at the bottom of the post, there is a form to select from a short list of tags, and it submits the tag id and the post id by POST to the script.

    I want to be sure that the following actions are all that are needed:

    1. Add a row to wp-term-relationships with the post id and the tag id.

    2. Add 1 to the count in wp_term_taxonomy for the tag id.

    C’est tout?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ericr23

    (@ericr23)

    Actually, I just realized that what I want to do is pretty much what’s available at the bottom of the right-hand column on this page, with a dropdown menu instead of a text input box. I see it runs /support/tag-add.php — any chance of sharing that script?

    Thread Starter ericr23

    (@ericr23)

    (I realize that these support pages must have a very different setup than a WordPress blog, but the script might still provide some guidance.)

    Thread Starter ericr23

    (@ericr23)

    Well, my script is written and working well, so I hope the 2 tasks described in my initial post are indeed all that are needed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Script to add tag to post’ is closed to new replies.