当前位置: 首页>>代码示例>>PHP>>正文


PHP wpgrade::merge方法代码示例

本文整理汇总了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;
 }
开发者ID:pwzCypher,项目名称:wp-push,代码行数:29,代码来源:WPGradePaginationFormatter.php


注:本文中的wpgrade::merge方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。