Skip to content

Instantly share code, notes, and snippets.

@thefuxia
Created August 20, 2012 04:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefuxia/3400778 to your computer and use it in GitHub Desktop.
Save thefuxia/3400778 to your computer and use it in GitHub Desktop.
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