BP_文档_文件夹_模板::_构造(大堆$args)
构造函数方法。
描述
传递到此类构造函数的参数的格式与BP_文档_文件夹::get().
另见
- BP_文档_文件夹::get():有关参数结构以及默认值的说明。
参数
- $args
-
(大堆)(必选)参数数组。支持来自的所有参数BP_文档_文件夹::get(),以及“页面参数”和“包含”。“每页”的默认值不同于原始函数,如下所述
来源
文件:bp document/classes/class-bp-document-folder-template.php
公共函数构造($args){$defaults=array('page'=>1,'perpage'=>20,'page'=>acpage','max'=>false,'user\u id'=>false,'fields'=>all','count\u total'=>false,'sort'=>false',include'=>false,'privacy'=>false,'search\u terms'=>false,);$r=wp\u解析($args,$defaults,$defaults);摘录($r)$this->pag_arg=sanitize_key($r['page_arg');$this->pag_page=bp_sanitize_pagination_arg($this->pag_arg,$r['page']);$this->pag_num=bp_sanitize_pagination_arg('num',$r['per_page'])获取登录用户最喜爱文件夹的数组。$this->my_favs=bp_Get_user_用户最喜爱文件夹($bp_logu/,'id(),true-bp);//根据ID获取特定文件夹项。如果(!empty($include)){$this->folders=bp\u folder\u get\u specific(数组('folder\u ids'=>explode(',',$include),'max'=>max,'count\u total'=>count\u total,'page'=>this->pag\u page',per\u page'=>this->pag\u num,'sort'=>sort','user\u ID'=>user\u ID,);//获取所有文件夹。}{$this->folders=bp\u folder\u get(数组('max'=>$max,'count\u total'=>$count\u total,'per\u page'=>$this->pag\u num,'page'=>$this->pag\u page,'sort'=>$sort',search\u terms'=>$search\u terms',user\u id'=>$user\u id',group\u id'=>$group\u id'=>$group\u id',exclude'>$privacy'=>privacy'=>//只有在进行了//“count\u total”查询时,才会设置total\u folder\u count属性。if(!is\u null($this->folders['total']){if(!$max | | max>=(int)$this->folders['total']{$this->total\u folders\u count=(int)$this->folders['total']}否则{$this->total\u folders\u count=(int)$max;}$this->has_more_items=$this->folders['folders'];$this->folders=$this->folders['folders'];if($max){if($max>=count($this->folders)){$this->folder_count=count($this->folders);}els{$this->folder count=$max;}els{$this->folder count count($this->文件夹总数&&(int)$this->pag_num){$this->pag_links=paginate_links(数组('base'=>add_query_arg($this->pag_arg,%#%),'format'=>,'total'=>ceil((int)$this->pag_num),'current'=>(int)$this->pag_页面,'prev_utext'=>,'prev_utext'=>,'larr;'buddyboss'>,'next('budduoss',','mid_size'=>1,'add_args'=>array(),);}
变更日志
版本 | 描述 |
---|---|
Buddyboss1.4.0 | 介绍。 |