Skip to content

Instantly share code, notes, and snippets.

@k4zuki02h4t4
Last active October 15, 2016 08:46
Show Gist options
  • Save k4zuki02h4t4/3245e14129cb73ab488ecd803d783015 to your computer and use it in GitHub Desktop.
Save k4zuki02h4t4/3245e14129cb73ab488ecd803d783015 to your computer and use it in GitHub Desktop.
WordPressのbody_class()関数とcomment_class()関数からログインIDを削除する。
<?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