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

WP_Widget_Tag_Cloud::form() public WP 2.8.0

Outputs the Tag Cloud widget settings form.

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

Хуков нет.

Возвращает

Null. Ничего.

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

$WP_Widget_Tag_Cloud = new WP_Widget_Tag_Cloud();
$WP_Widget_Tag_Cloud->form( $instance );
$instance(массив) (обязательный)
Current settings.

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

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

Код WP_Widget_Tag_Cloud::form() WP 5.5.1

wp-includes/widgets/class-wp-widget-tag-cloud.php
<?php
public function form( $instance ) {
	$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
	$count = isset( $instance['count'] ) ? (bool) $instance['count'] : false;
	?>
	<p>
		<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
		<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $title ); ?>" />
	</p>
	<?php
	$taxonomies       = get_taxonomies( array( 'show_tagcloud' => true ), 'object' );
	$current_taxonomy = $this->_get_current_taxonomy( $instance );

	switch ( count( $taxonomies ) ) {

		// No tag cloud supporting taxonomies found, display error message.
		case 0:
			?>
			<input type="hidden" id="<?php echo $this->get_field_id( 'taxonomy' ); ?>" name="<?php echo $this->get_field_name( 'taxonomy' ); ?>" value="" />
			<p>
				<?php _e( 'The tag cloud will not be displayed since there are no taxonomies that support the tag cloud widget.' ); ?>
			</p>
			<?php
			break;

		// Just a single tag cloud supporting taxonomy found, no need to display a select.
		case 1:
			$keys     = array_keys( $taxonomies );
			$taxonomy = reset( $keys );
			?>
			<input type="hidden" id="<?php echo $this->get_field_id( 'taxonomy' ); ?>" name="<?php echo $this->get_field_name( 'taxonomy' ); ?>" value="<?php echo esc_attr( $taxonomy ); ?>" />
			<?php
			break;

		// More than one tag cloud supporting taxonomy found, display a select.
		default:
			?>
			<p>
				<label for="<?php echo $this->get_field_id( 'taxonomy' ); ?>"><?php _e( 'Taxonomy:' ); ?></label>
				<select class="widefat" id="<?php echo $this->get_field_id( 'taxonomy' ); ?>" name="<?php echo $this->get_field_name( 'taxonomy' ); ?>">
				<?php foreach ( $taxonomies as $taxonomy => $tax ) : ?>
					<option value="<?php echo esc_attr( $taxonomy ); ?>" <?php selected( $taxonomy, $current_taxonomy ); ?>>
						<?php echo esc_html( $tax->labels->name ); ?>
					</option>
				<?php endforeach; ?>
				</select>
			</p>
			<?php
	}

	if ( count( $taxonomies ) > 0 ) {
		?>
		<p>
			<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" <?php checked( $count, true ); ?> />
			<label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'Show tag counts' ); ?></label>
		</p>
		<?php
	}
}