wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_render_widget_control › WordPress Function

Depuis5.8.0
Dépréciéen/a
wp_render_widget_control ( $id )
Paramètres:
  • (string) $id Widget ID.
    Requis: Oui
Retourne:
  • (string|null)
Défini(e) dans:
Codex:

Calls the control callback of a widget and returns the output.



Source

function wp_render_widget_control( $id ) {
	global $wp_registered_widget_controls;

	if ( ! isset( $wp_registered_widget_controls[ $id ]['callback'] ) ) {
		return null;
	}

	$callback = $wp_registered_widget_controls[ $id ]['callback'];
	$params   = $wp_registered_widget_controls[ $id ]['params'];

	ob_start();

	if ( is_callable( $callback ) ) {
		call_user_func_array( $callback, $params );
	}

	return ob_get_clean();
}