Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




image_link_input_fields [ WordPress Function ]

image_link_input_fields ( $post, $url_type = '' )
Parameters:
  • (unknown_type) $post
  • (unknown_type) $url_type
Returns:
  • (unknown)
Defined at:



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ý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics