Created
August 20, 2012 04:17
-
-
Save thefuxia/3400778 to your computer and use it in GitHub Desktop.
T5 Page to Seite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: T5 Page to Seite | |
* Plugin URI: http://toscho.de/?p=2079 | |
* Description: Ersetzt <code>/page/</code> durch <code>/seite/</code>. | |
* Version: 2012.08.20 | |
* Required: 3.3 | |
* Author: Thomas Scholz <info@toscho.de> | |
* Author URI: http://toscho.de | |
* License: MIT | |
* License URI: http://www.opensource.org/licenses/mit-license.php | |
*/ | |
if ( ! function_exists( 't5_page_to_seite' ) ) | |
{ | |
register_activation_hook( __FILE__ , 't5_flush_rewrite_on_init' ); | |
register_deactivation_hook( __FILE__ , 't5_flush_rewrite_on_init' ); | |
add_action( 'init', 't5_page_to_seite' ); | |
function t5_page_to_seite() | |
{ | |
$GLOBALS['wp_rewrite']->pagination_base = 'seite'; | |
} | |
function t5_flush_rewrite_on_init() | |
{ | |
if ( 'deactivate_' . plugin_basename( __FILE__ ) === current_filter() ) | |
{ | |
remove_action( 'init', 't5_page_to_seite' ); | |
} | |
add_action( 'init', 'flush_rewrite_rules', 11 ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment