WP_Customize_Manager::get_previewable_devices() WordPress Method

The WP_Customize_Manager::get_previewable_devices() method returns an array of devices that the Customizer can be previewed on.

WP_Customize_Manager::get_previewable_devices() #

Returns a list of devices to allow previewing.


Return

(array) List of devices with labels and default setting.


Top ↑

Source

File: wp-includes/class-wp-customize-manager.php

	public function get_previewable_devices() {
		$devices = array(
			'desktop' => array(
				'label'   => __( 'Enter desktop preview mode' ),
				'default' => true,
			),
			'tablet'  => array(
				'label' => __( 'Enter tablet preview mode' ),
			),
			'mobile'  => array(
				'label' => __( 'Enter mobile preview mode' ),
			),
		);

		/**
		 * Filters the available devices to allow previewing in the Customizer.
		 *
		 * @since 4.5.0
		 *
		 * @see WP_Customize_Manager::get_previewable_devices()
		 *
		 * @param array $devices List of devices with labels and default setting.
		 */
		$devices = apply_filters( 'customize_previewable_devices', $devices );

		return $devices;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More