LLMS_Admin_Builder::admin_bar_menu( WP_Admin_Bar $wp_admin_bar )

Add menu items to the WP Admin Bar to allow quiz returns to the dashboard from the course builder


Parameters Parameters

$wp_admin_bar

(WP_Admin_Bar) (Required) Instance of WP_Admin_Bar


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/class.llms.admin.builder.php

	public static function admin_bar_menu( $wp_admin_bar ) {

		// Partially lifted from `wp_admin_bar_site_menu()` in wp-includes/admin-bar.php.
		if ( current_user_can( 'read' ) ) {

			$wp_admin_bar->add_menu(
				array(
					'parent' => 'site-name',
					'id'     => 'dashboard',
					'title'  => __( 'Dashboard', 'lifterlms' ),
					'href'   => admin_url(),
				)
			);

			$wp_admin_bar->add_menu(
				array(
					'parent' => 'site-name',
					'id'     => 'llms-courses',
					'title'  => __( 'Courses', 'lifterlms' ),
					'href'   => admin_url( 'edit.php?post_type=course' ),
				)
			);

			wp_admin_bar_appearance_menu( $wp_admin_bar );

		}

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.24.0 Unknown.
3.16.7 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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