本文整理匯總了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;
}