Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Localize plugin for other languages

  • Loading branch information...
commit 8c656b9ee15cd92bf91631a955a693ee65151c42 1 parent 01e158b
@tlovett1 authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 safe-redirect-manager.php
View
14 safe-redirect-manager.php
@@ -70,6 +70,7 @@ public function __construct() {
add_action( 'admin_print_styles-post.php', array( $this, 'action_print_logo_css' ), 10, 1 );
add_action( 'admin_print_styles-post-new.php', array( $this, 'action_print_logo_css' ), 10, 1 );
add_filter( 'post_type_link', array( $this, 'filter_post_type_link' ), 10, 2 );
+ add_action( 'plugins_loaded', array( $this, 'action_plugins_loaded' ) );
// Search filters
add_filter( 'posts_join', array( $this, 'filter_search_join' ) );
@@ -78,6 +79,17 @@ public function __construct() {
}
/**
+ * Localize plugin
+ *
+ * @since 1.7
+ * @uses load_plugin_textdomain
+ * @return void
+ */
+ public function action_plugins_loaded() {
+ load_plugin_textdomain( 'safe-redirect-manager', false, basename( dirname( __FILE__ ) ) . '/languages' );
+ }
+
+ /**
* Join posts table with postmeta table on search
*
* @since 1.2
@@ -908,7 +920,7 @@ public function sanitize_redirect_from( $path, $allow_regex = false ) {
public function filter_post_type_link( $permalink, $post ) {
if ( $this->redirect_post_type != $post->post_type )
return $permalink;
-
+
// We can't do anything to provide a permalink
// for regex enabled redirects.
if ( get_post_meta( $post->ID, $this->meta_key_enable_redirect_from_regex, true ) )
Please sign in to comment.
Something went wrong with that request. Please try again.