Changeset 991236
- Timestamp:
- 09/16/2014 04:42:34 PM (11 years ago)
- Location:
- simple-redirect/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
simple-redirect.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-redirect/trunk/readme.txt
r990782 r991236 4 4 Requires at least: 2.5 5 5 Tested up to: 4.0 6 Stable tag: 4.0. 16 Stable tag: 4.0.2 7 7 8 8 Easily redirect any post or page to another page with a dropdown menu or by manually typing in a URL. Check out the screenshots. This plugin also changes permalinks and menus to point directly to the new location of the redirect - this prevents bots from getting a redirect and helps boost your SEO. -
simple-redirect/trunk/simple-redirect.php
r990782 r991236 2 2 /* 3 3 * Plugin Name: Simple Redirect 4 * Version: 4.0. 14 * Version: 4.0.2 5 5 * Description: Easily redirect any post or page to another page with a dropdown menu or by manually typing in a URL. This plugin also changes permalinks and menus to point directly to the new location of the redirect - this prevents bots from getting a redirect and helps boost your SEO. 6 6 * Author: Get on Social … … 21 21 var $priority = 'default'; 22 22 23 // used to prevent internal recursion 24 var $looking_up_link = false; 25 23 26 function __construct() 24 27 { … … 46 49 // for the actual redirect 47 50 add_action('template_redirect',array($this,'template_redirect'), 10 ); 51 48 52 49 53 // rewrite links to 301'd pages preemptively … … 58 62 add_filter('wp_nav_menu_objects',array($this,'wp_nav_menu_objects')); 59 63 64 65 60 66 } 61 67 … … 85 91 { 86 92 93 // used to prevent internal recursion 94 // special thanks to @khromov for describing a situation where this 95 // could cause errors 96 if( $this->looking_up_link ){ return $link; } 97 87 98 global $post; 88 89 99 90 100 if(!empty($post->ID)) … … 124 134 { 125 135 136 $this->looking_up_link = true; 126 137 $redirect_info = array(); 127 138 $redirect = get_post_meta( $post_id, $this->namespace, true ); … … 151 162 } 152 163 } 164 165 $this->looking_up_link = false; 153 166 return $redirect_info; 154 167 }
Note: See TracChangeset
for help on using the changeset viewer.