WP_Screen::render_screen_layout()publicWP 3.3.0

Renders the option for number of columns on the page.

Метод класса: WP_Screen{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$WP_Screen = new WP_Screen();
$WP_Screen->render_screen_layout();

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

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

Код WP_Screen::render_screen_layout() WP 6.4.3

<?php
public function render_screen_layout() {
	if ( ! $this->get_option( 'layout_columns' ) ) {
		return;
	}

	$screen_layout_columns = $this->get_columns();
	$num                   = $this->get_option( 'layout_columns', 'max' );

	?>
	<fieldset class='columns-prefs'>
	<legend class="screen-layout"><?php _e( 'Layout' ); ?></legend>
	<?php for ( $i = 1; $i <= $num; ++$i ) : ?>
		<label class="columns-prefs-<?php echo $i; ?>">
		<input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>' <?php checked( $screen_layout_columns, $i ); ?> />
		<?php
			printf(
				/* translators: %s: Number of columns on the page. */
				_n( '%s column', '%s columns', $i ),
				number_format_i18n( $i )
			);
		?>
		</label>
	<?php endfor; ?>
	</fieldset>
	<?php
}