Title: WP_Customize_Control::print_template
Published: December 18, 2014
Last modified: May 20, 2026

---

# WP_Customize_Control::print_template()

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/WP_Customize_Control/print_template/?output_format=md#description)
 * [Source](https://developer.wordpress.org/reference/classes/WP_Customize_Control/print_template/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/WP_Customize_Control/print_template/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/WP_Customize_Control/print_template/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/WP_Customize_Control/print_template/?output_format=md#wp--skip-link--target)

Renders the control’s JS template.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/WP_Customize_Control/print_template/?output_format=md#description)󠁿

This function is only run for control types that have been registered with [WP_Customize_Manager::register_control_type()](https://developer.wordpress.org/reference/classes/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.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/WP_Customize_Control/print_template/?output_format=md#source)󠁿

    ```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
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-control.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-customize-control.php#L692)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-customize-control.php#L692-L698)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/WP_Customize_Control/print_template/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Customize_Control::content_template()](https://developer.wordpress.org/reference/classes/wp_customize_control/content_template/)`wp-includes/class-wp-customize-control.php` |

An Underscore (JS) template for this control’s content (but not its container).

  | 
| [esc_attr()](https://developer.wordpress.org/reference/functions/esc_attr/)`wp-includes/formatting.php` |

Escaping for HTML attributes.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/WP_Customize_Control/print_template/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.1.0](https://developer.wordpress.org/reference/since/4.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_customize_control%2Fprint_template%2F)
before being able to contribute a note or feedback.