这是可行的,但最大的问题是解决分页问题,因为它完全被破坏了。
add_filter(\'post_limits\',\'wpse_33775_add_rows_to_media_library\',999,1);
function wpse_33775_add_rows_to_media_library($limits)
{
global $current_screen;
$tab = isset( $_GET[\'tab\'] ) ? $_GET[\'tab\'] : "type";
if( \'media-upload\' != $current_screen->id && \'library\' != $tab )
return $limits;
$my_new_limit = \'100\';
$limits = str_replace(\'10\',$my_new_limit,$limits); // replacing the default 10
return $limits;
}
有什么方法可以钩住这里吗?
/*
* WordPress 3.3.2
* /wp-admin/includes/media.php
* line 1828
*
*/
$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\']
));
if ( $page_links )
echo "<div class=\'tablenav-pages\'>$page_links</div>";