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


PHP Tribe__Events__Main::array_insert_before_key方法代码示例

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


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

示例1: settings_ui

 /**
  * Adds timezone settings to the *General* settings tab.
  *
  * When it is determined that timezone data still needs to be generated for one or more
  * events then only the update tool will be exposed in this area, in all other cases this
  * is not exposed and the ordinary timezone settings will be visible.
  *
  * @param array $general_settings
  *
  * @return array
  */
 public function settings_ui(array $general_settings)
 {
     $updater = new Tribe__Events__Admin__Timezone_Updater();
     // Load all timezone settings
     $timezone_settings = $this->get_settings_array();
     // Remove unneeded options: until timezone data has been updated, users should only see the update
     // button - after that point, they should see the "real" settings but not the update button
     if ($updater->update_needed()) {
         unset($timezone_settings['tribe_events_timezone_mode']);
         unset($timezone_settings['tribe_events_timezones_show_zone']);
     } else {
         unset($timezone_settings['tribe_events_enable_timezones']);
     }
     // Add the new section just before the settings form is closed
     return Tribe__Events__Main::array_insert_before_key('tribe-form-content-end', $general_settings, $timezone_settings);
 }
开发者ID:bostondv,项目名称:the-events-calendar,代码行数:27,代码来源:Timezone_Settings.php


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