WordPress.org

Ready to get started?Download WordPress

Forums

Simple 301 Redirects
Possible to move blank text box to top? (3 posts)

  1. mikeshinobi
    Member
    Posted 1 year ago #

    I have a site on which I have 200+ redirects using this plugin... It's working perfectly, however, anytime I need to put in more redirects, it's extremely tedious having to scroll to the bottom of the page each and every time when I have such a huge list of redirects. It would seem this problem could be solved easily if I could just move the blank text boxes to the top of the list instead of having them at the bottom. Could someone help me do this? It seems like a simple thing to do but I'm not sure how to do it.

    http://wordpress.org/extend/plugins/simple-301-redirects/

  2. mikeshinobi
    Member
    Posted 1 year ago #

    Well wouldn't you guess - I figured it out literally 2 minutes after I took the trouble to post on here.

    It was a simple fix, but I hate when people ask a question then say "never mind figured it out!" without sharing what they figured out, so I'll share it as well.

    In the plugin code, there's this

    <table>
    			<tr>
    				<th>Request</th>
    				<th>Destination</th>
    			</tr>
    			<tr>
    				<td><small>example: /about.htm</small></td>
    				<td><small>example: <?php echo get_option('home'); ?>/about/</small></td>
    			</tr>
    			<?php echo $this->expand_redirects(); ?>
    			<tr>
    				<td><input type="text" name="301_redirects[request][]" value="" style="width:15em" />&nbsp;&raquo;&nbsp;</td>
    				<td><input type="text" name="301_redirects[destination][]" value="" style="width:30em;" /></td>
    			</tr>
    		</table>

    And you just change it to this

    <table>
    			<tr>
    				<th>Request</th>
    				<th>Destination</th>
    			</tr>
    			<tr>
    				<td><small>example: /about.htm</small></td>
    				<td><small>example: <?php echo get_option('home'); ?>/about/</small></td>
    			</tr>
    
    			<tr>
    				<td><input type="text" name="301_redirects[request][]" value="" style="width:15em" />&nbsp;&raquo;&nbsp;</td>
    				<td><input type="text" name="301_redirects[destination][]" value="" style="width:30em;" /></td>
    			</tr>
    			<?php echo $this->expand_redirects(); ?>
    		</table>
  3. scottnelle
    Member
    Plugin Author

    Posted 1 year ago #

    Glad to hear you solved your own problem! I think I like your idea of having the empty field at the top for easier editing. I finally have some time to work on updates for this plugin in the next few weeks. I think I'll follow your example in the next release. :-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.