From 3f50d60a172f08bfb4001c39f0be39ab85e2dff2 Mon Sep 17 00:00:00 2001
From: Erick Hitter <ehitter@gmail.com>
Date: Thu, 7 Jun 2012 11:38:29 -0400
Subject: [PATCH] Incorporate changes by @mjandga in WP.com VIP version.

---
 external-permalinks-redux.php | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/external-permalinks-redux.php b/external-permalinks-redux.php
index c17375c..d608d7c 100644
--- a/external-permalinks-redux.php
+++ b/external-permalinks-redux.php
@@ -3,7 +3,7 @@
 Plugin Name: External Permalinks Redux
 Plugin URI: http://www.thinkoomph.com/plugins-modules/external-permalinks-redux/
 Description: Allows users to point WordPress objects (posts, pages, custom post types) to a URL of your choosing. Inspired by and backwards-compatible with <a href="http://txfx.net/wordpress-plugins/page-links-to/">Page Links To</a> by Mark Jaquith. Written for use on WordPress.com VIP.
-Version: 1.0.2
+Version: 1.0.3
 Author: Erick Hitter (Oomph, Inc.)
 Author URI: http://www.thinkoomph.com/
 
@@ -26,8 +26,8 @@ class external_permalinks_redux {
 	/*
 	 * Class variables
 	 */
-	var $meta_key_target;
-	var $meta_key_type;
+	var $meta_key_target = '_links_to';
+	var $meta_key_type = '_links_to_type';
 	var $status_codes;
 
 	/*
@@ -36,7 +36,7 @@ class external_permalinks_redux {
 	 * @return null
 	 */
 	function __construct() {
-		add_action( 'init', array( $this, 'action_init' ) );
+		add_action( 'init', array( $this, 'action_init' ), 0 ); // other init actions may rely on permalinks so filter early
 		add_action( 'admin_init', array( $this, 'action_admin_init' ) );
 		add_action( 'save_post', array( $this, 'action_save_post' ) );
 
@@ -54,8 +54,8 @@ class external_permalinks_redux {
 	 * @return null
 	 */
 	function action_init() {
-		$this->meta_key_target = apply_filters( 'epr_meta_key_target', '_links_to' );
-		$this->meta_key_type = apply_filters( 'epr_meta_key_type', '_links_to_type' );
+		$this->meta_key_target = apply_filters( 'epr_meta_key_target', $this->meta_key_target );
+		$this->meta_key_type = apply_filters( 'epr_meta_key_type', $this->meta_key_type );
 
 		$status_codes = array(
 			302 => __( 'Temporary (302)', 'external-permalinks-redux' ),
-- 
GitLab