Skip to content

Instantly share code, notes, and snippets.

@gatespace
Last active February 26, 2021 13:34
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gatespace/6007495 to your computer and use it in GitHub Desktop.
Save gatespace/6007495 to your computer and use it in GitHub Desktop.
<?php
/**
* @package content_mayuge_systems
* @version 0.1
*/
/*
Plugin Name: Content Mayuge Systems
Plugin URI: https://gist.github.com/gatespace/6007495
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