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


PHP EM_Locations::context方法代码示例

本文整理汇总了PHP中EM_Locations::context方法的典型用法代码示例。如果您正苦于以下问题:PHP EM_Locations::context方法的具体用法?PHP EM_Locations::context怎么用?PHP EM_Locations::context使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EM_Locations的用法示例。


在下文中一共展示了EM_Locations::context方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_default_search

 public static function get_default_search($array_or_defaults = array(), $array = array())
 {
     self::$context = EM_POST_TYPE_LOCATION;
     $defaults = array('eventful' => false, 'eventless' => false, 'orderby' => 'location_name', 'town' => false, 'state' => false, 'country' => false, 'region' => false, 'status' => 1, 'scope' => 'all', 'blog' => get_current_blog_id(), 'private' => current_user_can('read_private_locations'), 'private_only' => false, 'post_id' => false);
     //sort out whether defaults were supplied or just the array of search values
     if (empty($array)) {
         $array = $array_or_defaults;
     } else {
         $defaults = array_merge($defaults, $array_or_defaults);
     }
     //specific functionality
     if (EM_MS_GLOBAL) {
         if (get_site_option('dbem_ms_mainblog_locations')) {
             //when searching in MS Global mode with all locations being stored on the main blog, blog_id becomes redundant as locations are stored in one blog table set
             $array['blog'] = false;
         } elseif ((!is_admin() || defined('DOING_AJAX')) && empty($array['blog']) && is_main_site() && get_site_option('dbem_ms_global_locations')) {
             //if enabled, by default we display all blog locations on main site
             $array['blog'] = false;
         }
     }
     $array['eventful'] = !empty($array['eventful']) && $array['eventful'] == true;
     $array['eventless'] = !empty($array['eventless']) && $array['eventless'] == true;
     if (is_admin() && !defined('DOING_AJAX')) {
         $defaults['owner'] = !current_user_can('read_others_locations') ? get_current_user_id() : false;
     }
     return apply_filters('em_locations_get_default_search', parent::get_default_search($defaults, $array), $array, $defaults);
 }
开发者ID:KhanMaytok,项目名称:events-manager,代码行数:27,代码来源:em-locations.php

示例2: array

 function get_default_search($array = array())
 {
     self::$context = EM_POST_TYPE_LOCATION;
     $defaults = array('eventful' => false, 'eventless' => false, 'orderby' => 'location_name', 'town' => false, 'state' => false, 'country' => false, 'region' => false, 'status' => 1, 'scope' => 'all', 'blog' => get_current_blog_id(), 'private' => current_user_can('read_private_locations'), 'private_only' => false, 'post_id' => false);
     if (EM_MS_GLOBAL && get_site_option('dbem_ms_mainblog_locations')) {
         //when searching in MS Global mode with all locations being stored on the main blog, blog_id becomes redundant as locations are stored in one blog table set
         $array['blog'] = false;
     }
     $array['eventful'] = !empty($array['eventful']) && $array['eventful'] == true;
     $array['eventless'] = !empty($array['eventless']) && $array['eventless'] == true;
     if (is_admin()) {
         $defaults['owner'] = !current_user_can('read_others_locations') ? get_current_user_id() : false;
     }
     return apply_filters('em_locations_get_default_search', parent::get_default_search($defaults, $array), $array, $defaults);
 }
开发者ID:batruji,项目名称:metareading,代码行数:15,代码来源:em-locations.php


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