Home Forums Add-ons Gallery Field Image Upload Via Gallery Field Fails


Image Upload Via Gallery Field Fails

  • Hello,
    I created an acf form which uses shortcode, the fields it shows are inserted via parameters.
    I’ll add the code just in case its needed:

    add_shortcode( 'acfEdit', 'acf_edit' );
    function acf_edit( $atts ) {
        global $post;
        // Attributes
        $atts = shortcode_atts( array(
    	'fields' => array()
        ), $atts, 'acfEdit' );
        // Start
        $all_fields = $atts['fields'];
        $all_fields = explode(',',$all_fields);
        $post_name = get_post_field('post_name', $post->ID);
    	'post_id' => $post->ID,
        'fields' => $all_fields,
    	'return' => site_url() . '/' . $post_name . '/' . '?edited=' . $post->ID , 
    	'submit_value' => __("עדכן", 'acf'),
    	'uploader' => "basic",
    	'html_updated_message'  => '<div id="message" class="updated"><p>הדיגיטקט שלכם עודכן 
        // End             
        $html = ob_get_contents(); 
        return $html;

    The Code works fine with regular image fields but when I(or the users, tested with different type of user roles) try to upload image to the gallery the image ‘src’ attribute is broken and it seems that it cant upload properly.
    I am attaching a screen shot of the problem to this post, You will be able to see the image ‘src’ attribute as well as the image it self ( marked with an ‘x’).

    Anyone knows what might cause images to be uploaded badly only through the gallery field?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.