Welcome, visitor! Log in
 

Source View: plugins_per_page

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN  (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
463  
464  $plugin_array_name = "${status}_plugins";
465  if ( empty($$plugin_array_name) && !in_array($status, array('all', 'search')) ) {
466       $status = 'all';
467       $plugin_array_name = "${status}_plugins";
468  }
469  
470  $plugins = &$$plugin_array_name;
471  
472  // Paging.
473  $total_this_page = "total_{$status}_plugins";
474  $total_this_page = $$total_this_page;
475  $plugins_per_page = (int) get_user_option( 'plugins_per_page' );
476  if ( empty( $plugins_per_page ) || $plugins_per_page < 1 )
477       $plugins_per_page = 999;
478  $plugins_per_page = apply_filters( 'plugins_per_page', $plugins_per_page );
479  
480  $start = ($page - 1) * $plugins_per_page;
481  
482  $page_links = paginate_links( array(
483       'base' => add_query_arg( 'paged', '%#%' ),
484       'format' => '',
485       'prev_text' => __('&laquo;'),
486       'next_text' => __('&raquo;'),
487       'total' => ceil($total_this_page / $plugins_per_page),
488       'current' => $page
489  ));
490  $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
491       number_format_i18n( $start + 1 ),
492       number_format_i18n( min( $page * $plugins_per_page, $total_this_page ) ),
493       '<span class="total-type-count">' . number_format_i18n( $total_this_page ) . '</span>',