Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    After you upload a file, using the upload field, you should see a Remove link that you could use to delete the attached file?

    Try this and let me know if it works for you.

    Best regards,

    Thread Starter silvermtl

    (@silvermtl)

    hi Teodor,
    After I delete the file with the remove link, the file still exits on the server.

    and how can i echo”; the path /file/filename.mp3 for each attachment ?, im almost there with this code

    $args = array(
    ‘post_type’ => ‘attachment’,
    ‘numberposts’ => -1,
    ‘post_status’ => null,
    ‘post_parent’ => $post->ID
    );

    $attachments = get_posts( $args );
    if ( $attachments ) {
    foreach ( $attachments as $attachment ) {
    echo ‘

    • ‘;
      the_attachment_link( $attachment->ID, true );
    • }
      }

      endwhile; endif; ?>

    Hi,

    You can get the file path based on attachment ID by using this function.

    Also you can get the attachment ID by using WCK function as described in this documentation.

    Best regards,

    Thread Starter silvermtl

    (@silvermtl)

    in front end when i delete a attachement field i will like also deleting the file on the server

    in WCK-FEP.PHP i change :

    wp_delete_attachment( $attachment->ID );
    for:

    wp_delete_attachment( $postid, $force_delete );

    IT doesn’t work

    Plugin Author Razvan Mocanu

    (@razvanmo-1)

    Hello,

    When you create a post via WCK Front End Posting, but do not publish it, the draft will be deleted automatically after 12 hours. Along with it, all the attachments associated with this post are deleted too.
    The code you were referring to, is triggered only to auto drafts older than 12 hours.

    It is recommended to not modify the plugin files, because all your modifications will be deleted when you update the plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘upload/delete field type in front end’ is closed to new replies.