WP_Customize_Partial::render_callback() WordPress Method

The WP_Customize_Partial::render_callback() is a Wordpress method used to render a partial template. This method is called when the partial is rendered.

WP_Customize_Partial::render_callback( WP_Customize_Partial $partial, array $context = array() ) #

Default callback used when invoking WP_Customize_Control::render().


Description

Note that this method may echo the partial or return the partial as a string or array, but not both. Output buffering is performed when this is called. Subclasses can override this with their specific logic, or they may provide an ‘render_callback’ argument to the constructor.

This method may return an HTML string for straight DOM injection, or it may return an array for supporting Partial JS subclasses to render by applying to client-side templating.


Top ↑

Parameters

$partial

(WP_Customize_Partial)(Required)Partial.

$context

(array)(Optional)Context.

Default value: array()


Top ↑

Return

(string|array|false)


Top ↑

Source

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

	public function render_callback( WP_Customize_Partial $partial, $context = array() ) {
		unset( $partial, $context );
		return false;
	}

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.