Home / Archive / Post class update
Duplicate Snippet

Embed Snippet on Your Site

Post class update

Code Preview
php
<?php
add_filter( 'body_class', function( $classes ) {
	$acc_type=tmwp_get_user_role();
	if (!$acc_type)
		$acc_type='anonymous';
    return array_merge( $classes, array('acc-type-'.strtolower($acc_type),tmwp_get_page_class()) );
} );

Comments

Add a Comment