Support » Plugin: More Fields » [Plugin: More Fields] Media Library Only Shows 5 Images at a time and not 10

Viewing 12 replies - 1 through 12 (of 12 total)
  • I can’t help but notice the image count in your first capture (with plugin activated) is 1,539 and the image count in your second capture (with plugin deactivated) is only 86. I find that strange as well. Which is closer to being correct? Maybe another clue for someone to de-bug.

    The pictures are taken from different sites. I was testing different things out and took pics from the separate sites for whatever reason. Either way, site 1 has the plugin activated, site 2 I never installed it.

    Interesting! I was having this problem but I didn’t know what was causing it. I tested out disabling the More Fields plugin and that was the cause. My media library only shows 4 pictures at a time.

    After a lot of digging I found what is causing the bug (more Fields version I’m not sure what the best way to fix it would be since any change might break the way the plugin is supposed to work. But for the developers– this is what’s causing the bug.

    In the file more-fields-rewrite-object.php there is a line

    add_filter('posts_join', array(&$this, 'query_join'));

    that adds a filter called query_join.

    function query_join( $join ) {
    		global $wpdb, $wp_query;
    		if (!is_callable(array($wp_query, 'get'))) return false;
    		if ($key = $wp_query->get('mf_key') || $type = esc_attr($_GET['type'])) {
    			$join .= " LEFT JOIN $wpdb->postmeta as meta ON $wpdb->posts.ID = meta.post_id";
    		return $join;

    This adds a LEFT JOIN to the normal $wp_query request parameter. This causes each image to show up 3 times in a normal $wp_query.

    Then in the media library iframe the image links are paginated with the function:

    $page_links = paginate_links( array(
    	'base' => add_query_arg( 'paged', '%#%' ),
    	'format' => '',
    	'prev_text' => __('«'),
    	'next_text' => __('»'),
    	'total' => ceil($wp_query->found_posts / 10),
    	'current' => $_GET['paged']

    My media library should show 18 images split up onto 2 pages but since $wp_query->found_posts is 54 they’re split up onto six pages with 4 images on each page.

    As a temporary fix I’m going to comment out line 16 in more-fields-rewrite-object.php

    //add_filter('posts_join', array(&$this, 'query_join'));

    Nice detective work!! I am seeing 10 pics again, I just hope everything remains stable.

    Even stranger, I only saw three items at a time prior to commenting out that line. Thanks for locating it.

    There are many other bugs in this code, none of which existed in their ver 1.x code. Feature bloat always introduces bugs, and they seem to be having a hard time tracking them down.

    Major: In a textarea field, on more than one occasion the field was write-protected, and the values in it were lost when saving the record.

    Minor, but aggravating: The admin css includes code for images using the wrong URL. Add /wp/wp-admin/ in the URLs to resolve it.

    Plugin Author Kal Ström


    @mintydog: Feature bloat is not the case, I’d say (after all we removed the entire post type functionality for 2.0). But we rewrote the entire engine, which probably is the cause for the problems. But we do rely on bug reports to be able to make fixes.

    I am having this issue as well. When I deactivate the More Fields plugin the issue is resolved.

    Just wondering when the next version of the plugin is expected? No pressure!

    Adam Capriola


    This still wasn’t fixed in the latest plugin update a few days ago. 🙁



    I can confirm it wasn’t in the More Fields 2.1 update as well.

    I’ve updated, and my fix for this issue has been overwritten.

    Adam Capriola


    Try adding this to your functions.php and it should keep it fixed for good:

    remove_filter( 'posts_join', 'query_join' );

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: More Fields] Media Library Only Shows 5 Images at a time and not 10’ is closed to new replies.