WP_Customize_Nav_Menus::ajax_search_available_items

Advertisement

Summery Summery

Ajax handler for searching available menu items.

Syntax Syntax

WP_Customize_Nav_Menus::ajax_search_available_items()

Source Source

File: wp-includes/class-wp-customize-nav-menus.php

					'include'      => '',
					'number'       => 10,
					'offset'       => 10 * $page,
					'order'        => 'DESC',
					'orderby'      => 'count',
					'pad_counts'   => false,
				)
			);

			if ( is_wp_error( $terms ) ) {
				return $terms;
			}

			foreach ( $terms as $term ) {
				$items[] = array(
					'id'         => "term-{$term->term_id}",
					'title'      => html_entity_decode( $term->name, ENT_QUOTES, get_bloginfo( 'charset' ) ),
					'type'       => 'taxonomy',
					'type_label' => get_taxonomy( $term->taxonomy )->labels->singular_name,
					'object'     => $term->taxonomy,
					'object_id'  => intval( $term->term_id ),
					'url'        => get_term_link( intval( $term->term_id ), $term->taxonomy ),
				);
			}
		}

		/**
		 * Filters the available menu items.
		 *
		 * @since 4.3.0

Advertisement

Changelog Changelog

Changelog
Version Description
4.3.0 Introduced.

Advertisement

Leave a Reply