wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
image_link_input_fields › WordPress Function
Seit2.7.0
Veraltetn/v
› image_link_input_fields ( $post, $url_type = '' )
Parameter: (2) |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Retrieves HTML for the Link URL buttons with the default link type as specified.
Ähnliche Funktionen: image_align_input_fields, image_size_input_fields, get_link_to_edit, comment_id_fields, get_post_field
Quellcode
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 ( 'file' === $url_type ) { $url = $file; } elseif ( 'post' === $url_type ) { $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_url( $file ) . "'>" . __( 'File URL' ) . "</button> <button type='button' class='button urlpost' data-link-url='" . esc_url( $link ) . "'>" . __( 'Attachment Post URL' ) . '</button> '; }