AnsPress_Admin::render_menu()

Description #

Shows AnsPress menu meta box in WP menu editor.

Changelog #

VersionDescription
unknownIntroduced.

Source #

File: admin/anspress-admin.php

	public static function render_menu() {
		global $nav_menu_selected_id;

		$menu_items   = ap_menu_obejct();
		$walker       = new Walker_Nav_Menu_Checklist( false );
		$removed_args = array(
			'action',
			'customlink-tab',
			'edit-menu-item',
			'menu-item',
			'page-tab',
			'_wpnonce',
		);
		?>

		<div id="anspress-div">
			<div id="tabs-panel-anspress-all" class="tabs-panel tabs-panel-active">
			<ul id="anspress-checklist-pop" class="categorychecklist form-no-clear" >
				<?php
					echo walk_nav_menu_tree(
						array_map( 'wp_setup_nav_menu_item', $menu_items ),
						0,
						(object) array( 'walker' => $walker )
					);
				?>
			</ul>

			<p class="button-controls">
				<span class="list-controls">
					<?php
					$url = add_query_arg(
						array(
							'anspress-all' => 'all',
							'selectall'    => 1,
						),
						remove_query_arg( $removed_args )
					);
					$url = $url . '#anspress-menu-mb';
					?>
					<a href="<?php echo esc_url( $url ); ?>" class="select-all anspress-menu-mb"><?php esc_attr_e( 'Select All', 'anspress-question-answer' ); ?></a>
				</span>

				<span class="add-to-menu">
					<input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu', 'anspress-question-answer' ); ?>" name="add-anspress-menu-item" id="submit-anspress-div" />
					<span class="spinner"></span>
				</span>
			</p>
		</div>
		<?php
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment