Viewing 15 replies - 16 through 30 (of 37 total)
  • i have been working on a solution for the attachment issue and am making progress, in the meantime inserting the following in your themes function file should remove all the FG duplicates from the new insert dialog.

    remove_action( 'wp_ajax_query-attachments', 'wp_ajax_query_attachments', 1 );
    add_action( 'wp_ajax_query-attachments', 'my_ajax_query_attachments', 1 );
    
    $attach_parent = null;
    
    function my_ajax_query_attachments(){
    global $attach_parent;
    	$query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array();
    	$query = array_intersect_key( $query, array_flip( array(
    		's', 'order', 'orderby', 'posts_per_page', 'paged', 'post_mime_type',
    		'post_parent', 'post__in', 'post__not_in',
    	) ) );
    
    	$query['post_type'] = 'attachment';
    	$query['post_status'] = 'inherit';
    	if ( current_user_can( get_post_type_object( 'attachment' )->cap->read_private_posts ) )
    		$query['post_status'] .= ',private';
    	$attach_parent = $_REQUEST['post_id'];
    	add_filter('posts_where', 'filter_duplicate_attachments');
    	$query = new WP_Query( $query );
    	remove_filter('posts_where', 'filter_duplicate_attachments');
    	$attach_parent = null;
    	//error_log(print_r($query,true));
    	$posts = array_map( 'wp_prepare_attachment_for_js', $query->posts );
    	$posts = array_filter( $posts );
    
    	wp_send_json_success( $posts );
    }
    
    function filter_duplicate_attachments($input) {
    global $post, $attach_parent;
    if (!empty($attach_parent)){
    	$input .= " AND ((wp_posts.ID NOT IN ( SELECT ID FROM wp_posts AS ps INNER JOIN wp_postmeta AS pm ON pm.post_id = ps.ID WHERE pm.meta_key = '_is_copy_of' )) OR (wp_posts.post_parent=". $attach_parent ."))";
    }
    	return $input;
    }

    hope this helps some of you.

    Hi,

    Has anyone got a reply on how to inserd images with FG since 3.5?

    Regards,

    Luis

    Thread Starter Li-An

    (@li-an)

    Well, we are still waiting for the update. Aesqe may have a lot of other things to do I suppose…

    I thought I’d bump this. Has anybody any news on File Gallery?

    I love File Gallery, but I have areas in my sites that are reliant on it that could do with updating.

    I don’t mind waiting if an updated version is going to be produced, but if one isn’t then I need to move on. Not knowing is a nuisance.

    @pheonixgh how do you use your code to fix the duplicate images in the insert dialogue? ie where do I place the code?

    @gary

    You need to add the given code to your themes functions.php file.

    I have the same problem @jynk

    I need to attach an image to multiple posts

    When released the new version of the plugin?

    Plugin Author Aesqe

    (@aesqe)

    I’ll be posting dev updates on GitHub from now on, to speed things up.

    here’s the link: https://github.com/aesqe/file-gallery

    current version is 1.7.8-beta1 and it’s a first step to better WP 3.5 integration.

    I’ve managed to add the “Attach checked attachments to current post” button to the new media browser, so please test it out.

    For now, there is no visual clue if everything went fine or not other than the selection being cleared.

    The button disappears when attachment filter is set to files uploaded to current post, of course.

    let me know if it works or not for you.

    thanks! ??

    the beta version available on GitHub seems to duplicate the files already uploaded into the media library. so you can select any file from it and attach it to different posts but each time it’s been duplicated. or at least this is what happens to me…

    the beta version available on GitHub seems does not update automatically when when you attach a picture to the Filegallery box from media library.

    Plugin Author Aesqe

    (@aesqe)

    @christian70: I’ll add filtering of attachment copies soon, @pheonixgh’s solution looks good ??

    @mamastudios: latest beta on github should have that fixed – please test it out!

    @aesqe Hoping you can update to remove the duplicate media entries soon. Great plugin, and thanks for your work on it.

    @Aesque, I’m using the current beta from github and @mamastudios issue doesn’t appear to be fixed. I have to click “Refresh attachments” after closing the media editor. Could be related to the undefined id issue I posted to github?

    submitted a pull request for my duplicate filtering with an added visual indicator on attached items.
    pull request
    my fork

    HI everybody!
    I usually used to attach image to the post without showing the images in the content, so customers can upload images and attach them, then i create an automatic custom gallery with a shortcode.
    I’m using WP 3.5.2 and FG 1.7.8 beta 5.
    It works very well, there are still some bugs, but… (looking at the sky)… thank you very much Aesque ??

Viewing 15 replies - 16 through 30 (of 37 total)
  • The topic ‘[Plugin: File Gallery] WP 3.5 ?’ is closed to new replies.