• Resolved flapped

    (@flapped)


    Hello!

    I’m using Frontend Uploader on a page to upload posts I want to approve but set as private by default. I have auto approve on, and am using fu_after_upload to set posts as private, which works without issues with default form. However, when I set ‘suppress_default_fields=”true”‘, posts are not set as private anymore. I have checked that all the same hidden fields are sent, and tried both $post_id and $_POST[‘post_ID’] variables, but can’t get posts to be set as private with fu_after_upload.

    Shortcode:

    [fu-upload-form form_layout=”post_media” title=”It’s a title!” category=”13″ append_to_post=”true” suppress_default_fields=”true”]
    <form elements>
    [/fu-upload-form]

    php:

    add_action( ‘fu_after_upload’, ‘sl_fu_post’, 10, 3 );

    function sl_fu_post( $attachment_ids, $success, $post_id ) {
    //Hide it from regular Joes
    $sl_fu_post_args = array(
    ‘ID’ => $post_id,
    ‘post_status’ => ‘private’
    );
    wp_update_post( $sl_fu_post_args );
    };

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘fu_after_upload not firing when suppress_default_fields=”true” is set’ is closed to new replies.