Advertisements

image_link_input_fields

Definition:
function image_link_input_fields($post, $url_type = '') {}

Retrieve HTML for the Link URL buttons with the default link type as specified.

Parameters

  • unknown_type $post
  • unknown_type $url_type

Source code

function image_link_input_fields($post, $url_type = '') {



	$file = wp_get_attachment_url($post->ID);

	$link = get_attachment_link($post->ID);



	if ( empty($url_type) )

		$url_type = get_user_setting('urlbutton', 'post');



	$url = '';

	if ( $url_type == 'file' )

		$url = $file;

	elseif ( $url_type == 'post' )

		$url = $link;



	return "

	<input type='text' class='text urlfield' name='attachments[$post->ID][url]' value='" . esc_attr($url) . "' /><br />

	<button type='button' class='button urlnone' title=''>" . __('None') . "</button>

	<button type='button' class='button urlfile' title='" . esc_attr($file) . "'>" . __('File URL') . "</button>

	<button type='button' class='button urlpost' title='" . esc_attr($link) . "'>" . __('Post URL') . "</button>

";

}

1993

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

%d bloggers like this: