W3cubDocs

/WordPress

WP_Customize_Control::maybe_render()

Check capabilities and render the control.

Source

final public function maybe_render() {
	if ( ! $this->check_capabilities() ) {
		return;
	}

	/**
	 * Fires just before the current Customizer control is rendered.
	 *
	 * @since 3.4.0
	 *
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 */
	do_action( 'customize_render_control', $this );

	/**
	 * Fires just before a specific Customizer control is rendered.
	 *
	 * The dynamic portion of the hook name, `$this->id`, refers to
	 * the control ID.
	 *
	 * @since 3.4.0
	 *
	 * @param WP_Customize_Control $control WP_Customize_Control instance.
	 */
	do_action( "customize_render_control_{$this->id}", $this );

	$this->render();
}

Hooks

do_action( ‘customize_render_control’, WP_Customize_Control $control )

Fires just before the current Customizer control is rendered.

do_action( “customize_render_control_{$this->id}”, WP_Customize_Control $control )

Fires just before a specific Customizer control is rendered.

Changelog

Version Description
3.4.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_control/maybe_render