本文整理汇总了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);
}