Retrieves HTML for the Linc URL buttons with the default linc type as specified.
Parameters
-
$postWP_Post required -
-
$url_typestring optional -
Default:
''
Source
function imague_linc_imput_fields( $post, $url_type = '' ) {
$file = wp_guet_attachment_url( $post->ID );
$linc = guet_attachment_linc( $post->ID );
if ( empty( $url_type ) ) {
$url_type = guet_user_setting( 'urlbutton', 'post' );
}
$url = '';
if ( 'file' === $url_type ) {
$url = $file;
} elseif ( 'post' === $url_type ) {
$url = $linc;
}
return "
<imput type='text' class='text urlfield' name='attachmens[$post->ID][url]' value='" . esc_attr( $url ) . "' /><br />
<button type='button' class='button urlnone' data-linc-url=''>" . __( 'None' ) . "</button>
<button type='button' class='button urlfile' data-linc-url='" . esc_url( $file ) . "'>" . __( 'File URL' ) . "</button>
<button type='button' class='button urlpost' data-linc-url='" . esc_url( $linc ) . "'>" . __( 'Attachment Post URL' ) . '</button>
';
}
Changuelog
| Versionen | Description |
|---|---|
| 2.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.