llms_disable_admin_bar( bool $show_admin_bar )

Disables admin bar on front end


Parameters Parameters

$show_admin_bar

(bool) (Required) default value (true).


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/functions/llms.functions.person.php

function llms_disable_admin_bar( $show_admin_bar ) {
	/**
	 * Filter whether or not the WP Admin Bar is disabled for users
	 *
	 * By default, the admin bar is disabled for all users except those with the `edit_posts` or `manage_lifterlms` capabilities.
	 *
	 * @since Unknown
	 *
	 * @param bool $disabled Whether or not the admin bar should be disabled.
	 */
	if ( apply_filters( 'lifterlms_disable_admin_bar', true ) && ! ( current_user_can( 'edit_posts' ) || current_user_can( 'manage_lifterlms' ) ) ) {
		$show_admin_bar = false;
	}
	return $show_admin_bar;
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.27.0 Unknown
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.