WP_Customize_Control::print_template() WordPress Method

The WP_Customize_Control::print_template() method is used to print a custom control template. This method is used to display the control interface for a custom control. It can be used to display the control interface for a standard control, but this is not recommended. The template for a custom control is loaded from the /wp-admin/customize/controls/{$type}-template.php file.

WP_Customize_Control::print_template() #

Render the control’s JS template.


Description

This function is only run for control types that have been registered with WP_Customize_Manager::register_control_type().

In the future, this will also print the template for the control’s container element and be override-able.


Top ↑

Source

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

	final public function print_template() {
		?>
		<script type="text/html" id="tmpl-customize-control-<?php echo esc_attr( $this->type ); ?>-content">
			<?php $this->content_template(); ?>
		</script>
		<?php
	}


Top ↑

Changelog

Changelog
VersionDescription
4.1.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.