image_align_input_fields

Definition:
function image_align_input_fields( $post, $checked = '' ) {}

Retrieve HTML for the image alignment radio buttons with the specified one checked.

Parameters

  • unknown_type $post
  • unknown_type $checked

Source code

function image_align_input_fields( $post, $checked = '' ) {



	if ( empty($checked) )

		$checked = get_user_setting('align', 'none');



	$alignments = array('none' => __('None'), 'left' => __('Left'), 'center' => __('Center'), 'right' => __('Right'));

	if ( !array_key_exists( (string) $checked, $alignments ) )

		$checked = 'none';



	$out = array();

	foreach ( $alignments as $name => $label ) {

		$name = esc_attr($name);

		$out[] = "<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'".

1977

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: