WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

WP_Customize_Nav_Menus::print_post_type_container() protected WP 4.7.0

Print the markup for new menu items.

To be used in the template #available-menu-items.

{} Это метод класса: WP_Customize_Nav_Menus{}

Хуков нет.

Возвращает

null.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->print_post_type_container( $available_item_type );
$available_item_type(массив) (обязательный)
Menu item data to output, including title, type, and label.

Список изменений

С версии 4.7.0 Введена.

Код WP_Customize_Nav_Menus::print_post_type_container() WP 5.5.3

<?php
protected function print_post_type_container( $available_item_type ) {
	$id = sprintf( 'available-menu-items-%s-%s', $available_item_type['type'], $available_item_type['object'] );
	?>
	<div id="<?php echo esc_attr( $id ); ?>" class="accordion-section">
		<h4 class="accordion-section-title" role="presentation">
			<?php echo esc_html( $available_item_type['title'] ); ?>
			<span class="spinner"></span>
			<span class="no-items"><?php _e( 'No items' ); ?></span>
			<button type="button" class="button-link" aria-expanded="false">
				<span class="screen-reader-text">
				<?php
					/* translators: %s: Title of a section with menu items. */
					printf( __( 'Toggle section: %s' ), esc_html( $available_item_type['title'] ) );
				?>
					</span>
				<span class="toggle-indicator" aria-hidden="true"></span>
			</button>
		</h4>
		<div class="accordion-section-content">
			<?php if ( 'post_type' === $available_item_type['type'] ) : ?>
				<?php $post_type_obj = get_post_type_object( $available_item_type['object'] ); ?>
				<?php if ( current_user_can( $post_type_obj->cap->create_posts ) && current_user_can( $post_type_obj->cap->publish_posts ) ) : ?>
					<div class="new-content-item">
						<label for="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>" class="screen-reader-text"><?php echo esc_html( $post_type_obj->labels->add_new_item ); ?></label>
						<input type="text" id="<?php echo esc_attr( 'create-item-input-' . $available_item_type['object'] ); ?>" class="create-item-input" placeholder="<?php echo esc_attr( $post_type_obj->labels->add_new_item ); ?>">
						<button type="button" class="button add-content"><?php _e( 'Add' ); ?></button>
					</div>
				<?php endif; ?>
			<?php endif; ?>
			<ul class="available-menu-items-list" data-type="<?php echo esc_attr( $available_item_type['type'] ); ?>" data-object="<?php echo esc_attr( $available_item_type['object'] ); ?>" data-type_label="<?php echo esc_attr( isset( $available_item_type['type_label'] ) ? $available_item_type['type_label'] : $available_item_type['type'] ); ?>"></ul>
		</div>
	</div>
	<?php
}