mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
wp_parse_str() from mdawaffe. see #4467
git-svn-id: https://develop.svn.wordpress.org/trunk@5709 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -968,27 +968,24 @@ function language_attributes() {
|
||||
echo $output;
|
||||
}
|
||||
|
||||
function paginate_links( $arg = '' ) {
|
||||
if ( is_array($arg) )
|
||||
$a = &$arg;
|
||||
else
|
||||
parse_str($arg, $a);
|
||||
function paginate_links( $args = '' ) {
|
||||
$defaults = array(
|
||||
'base' => '%_%', // http://example.com/all_posts.php%_% : %_% is replaced by format (below)
|
||||
'format' => '?page=%#%', // ?page=%#% : %#% is replaced by the page number
|
||||
'total' => 1,
|
||||
'current' => 0,
|
||||
'show_all' => false,
|
||||
'prev_next' => true,
|
||||
'prev_text' => __('« Previous'),
|
||||
'next_text' => __('Next »'),
|
||||
'end_size' => 1, // How many numbers on either end including the end
|
||||
'mid_size' => 2, // How many numbers to either side of current not including current
|
||||
'type' => 'plain',
|
||||
'add_args' => false // array of query args to aadd
|
||||
);
|
||||
|
||||
// Defaults
|
||||
$base = '%_%'; // http://example.com/all_posts.php%_% : %_% is replaced by format (below)
|
||||
$format = '?page=%#%'; // ?page=%#% : %#% is replaced by the page number
|
||||
$total = 1;
|
||||
$current = 0;
|
||||
$show_all = false;
|
||||
$prev_next = true;
|
||||
$prev_text = __('« Previous');
|
||||
$next_text = __('Next »');
|
||||
$end_size = 1; // How many numbers on either end including the end
|
||||
$mid_size = 2; // How many numbers to either side of current not including current
|
||||
$type = 'plain';
|
||||
$add_args = false; // array of query args to aadd
|
||||
|
||||
extract($a);
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
extract($args, EXTR_SKIP);
|
||||
|
||||
// Who knows what else people pass in $args
|
||||
$total = (int) $total;
|
||||
|
||||
Reference in New Issue
Block a user