LLMS_Forms_Admin_Bar::add_menu_items( WP_Admin_Bar $wp_admin_bar )

Add view links to the admin menu bar for qualifying users.


Parameters Parameters

$wp_admin_bar

(WP_Admin_Bar) (Required) Admin bar class instance.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/forms/class-llms-forms-admin-bar.php

	public function add_menu_items( $wp_admin_bar ) {

		if ( ! $this->should_display() ) {
			return;
		}

		$args = array( $this->get_current_location() );
		$plan = llms_filter_input( INPUT_GET, 'plan', FILTER_SANITIZE_NUMBER_INT );
		if ( $plan ) {
			$args[] = array( 'plan' => llms_get_post( $plan ) );
		}
		$form = llms_get_form( ...$args );

		$wp_admin_bar->add_node(
			array(
				'id'     => 'llms-edit-form',
				'parent' => 'edit',
				'title'  => __( 'Edit Form', 'lifterlms' ),
				'href'   => get_edit_post_link( $form->ID ),
			)
		);

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.5.1 Use should_display() method to determine if the view manager should be added to the admin bar.
4.2.0 Updated icon.
4.16.0 Retrieve nodes to add from get_menu_items_to_add().
3.7.0
3.16.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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