Changeset 990782
- Timestamp:
- 09/16/2014 04:51:08 AM (11 years ago)
- Location:
- simple-redirect/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
simple-redirect.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-redirect/trunk/readme.txt
r757451 r990782 1 === SimpleRedirect ===1 === Redirect === 2 2 Contributors: Get on Social 3 Tags: redirect, headers, posts, redirection, simple, easy, SEO, 3013 Tags: redirect, redirects, headers, posts, redirection, simple, easy, SEO, 301 4 4 Requires at least: 2.5 5 Tested up to: 3.66 Stable tag: /trunk/5 Tested up to: 4.0 6 Stable tag: 4.0.1 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. 9 9 10 == Description ==10 == Description and Use == 11 11 12 12 Simple redirection from pages or posts with an easy to use menu. … … 24 24 25 25 1. Use the meta box to add or edit permalinks 26 2. Easily choose existing content with a popup menu27 3. Link to a custom URL, existing content, or disable redirection -
simple-redirect/trunk/simple-redirect.php
r757440 r990782 2 2 /* 3 3 * Plugin Name: Simple Redirect 4 * Version: 3.0.14 * Version: 4.0.1 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 7 * Contributors: Get on Social, khromov 7 8 * Author URI: http://www.getonsocial.com/?simpleredirect 8 9 * License: GPL v3 … … 17 18 var $namespace = 'gos_simple_redirect'; 18 19 var $title = 'Simple Redirect'; 19 var $postTypes = array();20 20 var $context = 'side'; 21 21 var $priority = 'default'; … … 24 24 { 25 25 26 $this->postTypes = get_post_types(); 26 // special thanks to @khromov for the register_hooks improvement 27 add_action('init', array($this, 'register_hooks')); 28 29 } 30 31 function register_hooks() 32 { 33 34 35 // hooks for loading the meta boxes on the post page 27 36 add_action( 'load-post.php', array($this,'load_post') ); 28 37 add_action( 'load-post-new.php', array($this,'load_post') ); 29 38 39 // javascript for the footer of creating new posts and editing posts 30 40 add_action( 'admin_footer-post-new.php', array($this,'footerjs'), 9999 ); 31 41 add_action( 'admin_footer-post.php', array($this,'footerjs'), 9999 ); 32 42 33 43 // ajax calls 34 44 add_action( 'wp_ajax_'.$this->namespace, array($this,'wp_ajax'), 9999 ); 45 46 // for the actual redirect 35 47 add_action('template_redirect',array($this,'template_redirect'), 10 ); 36 48 37 49 // rewrite links to 301'd pages preemptively 38 50 add_filter('post_link',array($this,'post_link'),20,2); 39 51 add_filter('post_type_link',array($this,'post_link'),20,2); 40 52 53 // rewrite nav menu links to 301'd pages preemptively. 54 // i.e. when people create a top-level menu item to go to a subpage, such 55 // as when you have a structure like /about/ and /about/about-us/ and /about/contact/ 56 // but /about/ just redirects to /about/about-us/ - the menu link is rewritten to 57 // prevent an extra 301 "hop" 41 58 add_filter('wp_nav_menu_objects',array($this,'wp_nav_menu_objects')); 42 43 59 44 60 } … … 164 180 { 165 181 166 foreach($this->postTypes as $postType) 182 // allow use of a filter to modify the enabled post types 183 // eg: add_filter('gos_simple_redirect_enabled_post_types', ... ) 184 $enabledPostTypes = apply_filters( 'gos_simple_redirect_enabled_post_types', get_post_types() ); 185 186 foreach($enabledPostTypes as $postType) 167 187 { 168 188 add_meta_box(
Note: See TracChangeset
for help on using the changeset viewer.