Advertisements

_register_widget_form_callback

Definition:
function _register_widget_form_callback($id, $name, $form_callback, $options = array() {}

Parameters

  • $id
  • $name
  • $form_callback
  • $options

Source code

function _register_widget_form_callback($id, $name, $form_callback, $options = array()) {

	global $wp_registered_widget_controls;



	$id = strtolower($id);



	if ( empty($form_callback) ) {

		unset($wp_registered_widget_controls[$id]);

		return;

	}



	if ( isset($wp_registered_widget_controls[$id]) && !did_action( 'widgets_init' ) )

		return;



	$defaults = array('width' => 250, 'height' => 200 );

	$options = wp_parse_args($options, $defaults);

	$options['width'] = (int) $options['width'];

	$options['height'] = (int) $options['height'];



	$widget = array(

		'name' => $name,

		'id' => $id,

		'callback' => $form_callback,

		'params' => array_slice(func_get_args(), 4)

	);

	$widget = array_merge($widget, $options);



	$wp_registered_widget_controls[$id] = $widget;

}

4361

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: