Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_attachment_fields_to_edit($post, $errors = null) {
- if ( is_int($post) )
- $post =& get_post($post);
- if ( is_array($post) )
- $post = (object) $post;
- $image_url = wp_get_attachment_url($post->ID);
- $edit_post = sanitize_post($post, 'edit');
- $form_fields = array(
- 'post_title' => array(
- 'label' => __('Title'),
- 'value' => $edit_post->post_title
- ),
- 'image_alt' => array(),
- 'post_excerpt' => array(
- 'label' => __('Caption'),
- 'value' => $edit_post->post_excerpt
- ),
- 'post_content' => array(
- 'label' => __('Description'),
- 'value' => $edit_post->post_content,
- 'input' => 'textarea'
- ),
- 'url' => array(
- 'label' => __('Link URL'),
- 'input' => 'html',
- 'html' => image_link_input_fields($post, get_option('image_default_link_type')),
- 'helps' => __('Enter a link URL or click above for presets.')
- ),
- 'menu_order' => array(
- 'label' => __('Order'),
- 'value' => $edit_post->menu_order
- ),
- 'image_url' => array(
- 'label' => __('File URL'),
- 'input' => 'html',
- 'html' => "<input type='text' class='text urlfield' readonly='readonly' name='attachments[$post->ID][url]' value='" . esc_attr($image_url) . "' /><br />",
- 'value' => wp_get_attachment_url($post->ID),
- 'helps' => __('Location of the uploaded file.')
- )
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement