Simple 301 Redirects
[resolved] Additional fields (4 posts)

  1. seanprice
    Posted 5 years ago #

    Love this plugin but if I wanted to add an additional field to add to the database so not only the only URL and landing page but for example Redirect Title.

    I have added the additional field to the page but cannot get it to save to the DB?

  2. Scott Nelle
    Plugin Author

    Posted 5 years ago #

    Right now I'm storing the data in the wp_options table because it's easy to use when you've got 2 pieces of data for each redirect (a redirect and a destination.) If you want to add a third piece of data (title) you'll probably want to move the data to it's own table. To do so, you'll have to modify the save_redirects(), expand_redirects(), and redirect() functions. Basically every spot where you see get_option() or update_option() you'll need to modify the code to store your data in a new table. You'll also have to write an install function that creates the table. You'll probably also want to rename the plugin so the next time I update it doesn't wipe out your changes.

    Good luck!

  3. seanprice
    Posted 5 years ago #

    Thanks, solved it a little while ago.

  4. freedom1
    Posted 5 years ago #

    So, if I install this plug in, can it be set to say make it so that if someone clicks on link http://www.ourhometools.com/bostitch-tools.php it will transfer to my correct page at http://www.ourhometools.com/bostitch-tools and will I have to do the same thing for every URL ending .php?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple 301 Redirects
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic