Skip to content

Instantly share code, notes, and snippets.

@maor
Created October 12, 2014 18:06
Show Gist options
  • Save maor/17d3f69956655b071f6c to your computer and use it in GitHub Desktop.
Save maor/17d3f69956655b071f6c to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Just Give Me Berlin.
Plugin URI: http://www.berlin.de/en/
Description: Berlin. Nuff said.
Author: A Berliner
Author URI: http://www.findme.in/berlin
Version: 0.0
*/
function berlin_replace( $text ) {
$search = array(
'תל אביב',
'ירושלים',
'באר שבע',
'חיפה',
'ראשון לציון',
'אשדוד',
// ....
'ירוחם', // WAT?
);
return str_replace( $search, 'ברלין', $text );
}
foreach ( array( 'the_content', 'the_title', 'wp_title' ) as $filter )
add_filter( $filter, 'berlin_replace' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment