image_link_input_fields [ WordPress Function ]
image_link_input_fields ( $post, $url_type = '' )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: image_align_input_fields, image_size_input_fields, get_link_to_edit, comment_id_fields, get_post_field
Retrieve HTML for the Link URL buttons with the default link type as specified.
Source
<?php
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' data-link-url=''>" . __('None') . "</button>
<button type='button' class='button urlfile' data-link-url='" . esc_attr($file) . "'>" . __('File URL') . "</button>
<button type='button' class='button urlpost' data-link-url='" . esc_attr($link) . "'>" . __('Attachment Post URL') . "</button>
";
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- image_link_input_fields | A HitchHackers guide through WordPress
Feb 12, 2011 ... function image_link_input_fields($post, $url_type = '') { $file = wp_get_attachment_url($post->ID); $link = get_attachment_link($post->ID); ...
hitchhackerguide.com - #10809 (add another button to "image_link_input_fields" function, or ...
add another button to "image_link_input_fields" function, or add output filtering ... "image_link_input_fields" function outputs one input field and 3 buttons in ...
core.trac.wordpress.org - #19181 (Make image_link_input_fields filterable to add buttons ...
This patch makes the image_link_input_fields function filterable, so that additional buttons could be added to the Link URL section when inserting an image into ...
core.trac.wordpress.org - Make Wordpress show/link-to large images (instead of original – full ...
Feb 14, 2010 ... Just replace/modify this image_link_input_fields function in wp-admin/includes/ media.php (around line #874, based on 2.9.1 version) so it ...
ursimon.musichall.cz