本文整理汇总了PHP中wpgrade::merge方法的典型用法代码示例。如果您正苦于以下问题:PHP wpgrade::merge方法的具体用法?PHP wpgrade::merge怎么用?PHP wpgrade::merge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wpgrade
的用法示例。
在下文中一共展示了wpgrade::merge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup
protected function setup()
{
// the boring defaults that are ommited in the wpgrade-config.php
// configuration for clarity and bravity, and also because some require
// extensive logic handling
$defaults = array('base' => str_replace(999999999, '%#%', esc_url(get_pagenum_link(999999999))), 'format' => $this->pager_format($this->pager), 'current' => max(1, get_query_var($this->pager)), 'total' => $this->query->max_num_pages, 'formatter' => null, 'prev_next' => true, 'sorted_paging' => false, 'order' => 'desc', 'show_all' => false, 'end_size' => 1, 'mid_size' => 2, 'add_args' => false, 'add_fragment' => null);
$conf = wpgrade::merge($defaults, $this->conf);
# we're filling in prev_text and next_text seperatly to avoid
# requesting the translation when not required
if (empty($conf['prev_text'])) {
$conf['prev_text'] = __('« Previous', 'rosa_txtd');
} else {
// exists; translate
$conf['prev_text'] = __($conf['prev_text'], 'rosa_txtd');
}
if (empty($conf['next_text'])) {
$conf['next_text'] = __('Next »', 'rosa_txtd');
} else {
// exists; translate
$conf['next_text'] = __($conf['next_text'], 'rosa_txtd');
}
// is the pager sorted?
if ($conf['sorted_paging'] && $conf['order'] == 'asc') {
$temp = $conf['prev_text'];
$conf['prev_text'] = $conf['next_text'];
$conf['next_text'] = $temp;
}
return $conf;
}