WordPress at a glance
function is not described

WP_Customize_Partial::render() WP 4.5.0

Renders the template partial involving the associated settings.

This is a method of the class: WP_Customize_Partial

Return

String/Array/false. The rendered partial as a string, raw data array (for client-side JS template), or false if no render applied.

Usage

$WP_Customize_Partial = new WP_Customize_Partial();
$var = $WP_Customize_Partial->render( $container_context );
$container_context(array)
Array of context data associated with the target container (placement).
Default: empty array

Changelog

Since 4.5.0 Introduced.

Code of WP Customize Partial::render: wp-includes/customize/class-wp-customize-partial.php WP 5.4.1

<?php
final public function render( $container_context = array() ) {
	$partial  = $this;
	$rendered = false;

	if ( ! empty( $this->render_callback ) ) {
		ob_start();
		$return_render = call_user_func( $this->render_callback, $this, $container_context );
		$ob_render     = ob_get_clean();

		if ( null !== $return_render && '' !== $ob_render ) {
			_doing_it_wrong( __FUNCTION__, __( 'Partial render must echo the content or return the content string (or array), but not both.' ), '4.5.0' );
		}

		/*
		 * Note that the string return takes precedence because the $ob_render may just\
		 * include PHP warnings or notices.
		 */
		$rendered = null !== $return_render ? $return_render : $ob_render;
	}

	/**
	 * Filters partial rendering.
	 *
	 * @since 4.5.0
	 *
	 * @param string|array|false   $rendered          The partial value. Default false.
	 * @param WP_Customize_Partial $partial           WP_Customize_Setting instance.
	 * @param array                $container_context Optional array of context data associated with
	 *                                                the target container.
	 */
	$rendered = apply_filters( 'customize_partial_render', $rendered, $partial, $container_context );

	/**
	 * Filters partial rendering for a specific partial.
	 *
	 * The dynamic portion of the hook name, `$partial->ID` refers to the partial ID.
	 *
	 * @since 4.5.0
	 *
	 * @param string|array|false   $rendered          The partial value. Default false.
	 * @param WP_Customize_Partial $partial           WP_Customize_Setting instance.
	 * @param array                $container_context Optional array of context data associated with
	 *                                                the target container.
	 */
	$rendered = apply_filters( "customize_partial_render_{$partial->id}", $rendered, $partial, $container_context );

	return $rendered;
}