-
-
Save k4zuki02h4t4/3245e14129cb73ab488ecd803d783015 to your computer and use it in GitHub Desktop.
WordPressのbody_class()関数とcomment_class()関数からログインIDを削除する。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds custom classes to the array of body classes. | |
* | |
* @param array $classes Classes for the body element. | |
* | |
* @return array | |
* @copyright KUCKLU & VisuAlive | |
*/ | |
function themeslug_body_class( $classes ) { | |
return preg_grep( '/\Aauthor\-.+\z/i', $classes, PREG_GREP_INVERT ); | |
} | |
add_action( 'body_class', 'themeslug_body_class' ); | |
/** | |
* Adds custom classes to the array of comment classes. | |
* | |
* @param array $classes Classes for the comment element. | |
* | |
* @return array | |
* @copyright KUCKLU & VisuAlive | |
*/ | |
function themeslug_comment_class( $classes ) { | |
return preg_grep( '/\Acomment\-author\-.+\z/i', $classes, PREG_GREP_INVERT ); | |
} | |
add_action( 'comment_class', 'themeslug_comment_class' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment