Add more rows on media picker

my plugin: http://wordpress.org/extend/plugins/mediapicker-more-rows/

I found a way to fix the pagination

There is a way you can ‘hook’ into paginate_links. There is no official hook for it, but you can change the $wp_query->found_posts variable.

What I did here is ‘hooking’ into the paginate_links by abusing the media_upload_mime_type_links filter and setting a new value for $wp_query->found_posts.

This filter is triggered just before paginate_links is called.

function set_paginate_limit_mediapicker( $type_links )
{   
    global $wp_query;       

    $new_limit = 30; // set your limit
    $wp_query->found_posts = $wp_query->found_posts / ( $new_limit / 10 );

    return $type_links; // not used 
}   
add_filter( 'media_upload_mime_type_links', 'set_paginate_limit_mediapicker', 1 );

I have made a WordPress plugin for the complete solution, which you will find in the repository.

http://wordpress.org/extend/plugins/mediapicker-more-rows/

Leave a Comment