Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ShinichiNishikawa/6008741 to your computer and use it in GitHub Desktop.
Save ShinichiNishikawa/6008741 to your computer and use it in GitHub Desktop.
<?php
/**
* @package content_mayuge_systems
* @version 0.2
*/
/*
Plugin Name: Content Mayuge Systems
Plugin URI: http://wordpress.org/extend/plugins/hello-dolly/
Description: 本文中に句点「。」があると「( ・ิω・)╯ิ」がくっつきます。
Author: gatespace
Version: 0.1
Author URI: http://gatespace.jp/
*/
add_filter('the_content', 'content_mayuge_systems');
function content_mayuge_systems( $content )
{
$pattern = '/(。|まゆげ|マユゲ|まゆ毛|眉毛|わたし|私|ぼく|僕)/';
$replace = '$1 ( ・ิω・)╯ิ ';
$content = preg_replace( $pattern , $replace , $content );
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment