Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
T5 Page to Seite
<?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