本文整理汇总了PHP中FrmAppHelper::human_time_diff方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper::human_time_diff方法的具体用法?PHP FrmAppHelper::human_time_diff怎么用?PHP FrmAppHelper::human_time_diff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmAppHelper
的用法示例。
在下文中一共展示了FrmAppHelper::human_time_diff方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: human_time_diff
public static function human_time_diff($from, $to = '')
{
_deprecated_function(__FUNCTION__, '2.0', 'FrmAppHelper::human_time_diff');
return FrmAppHelper::human_time_diff($from, $to);
}
示例2: display_list
public static function display_list($message = '', $errors = array())
{
global $wpdb, $frm_vars;
$form = FrmForm::get_current_form();
$params = FrmForm::get_admin_params($form);
if ($form) {
$params['form'] = $form->id;
$frm_vars['current_form'] = $form;
if ('trash' == $form->status) {
$delete_timestamp = time() - DAY_IN_SECONDS * EMPTY_TRASH_DAYS;
$time_to_delete = FrmAppHelper::human_time_diff($delete_timestamp, isset($form->options['trash_time']) ? $form->options['trash_time'] : time());
$errors['trash'] = sprintf(__('This form is in the trash and is scheduled to be deleted permanently in %s along with any entries.', 'formidable'), $time_to_delete);
unset($time_to_delete, $delete_timestamp);
}
}
$table_class = apply_filters('frm_entries_list_class', 'FrmEntriesListHelper');
$wp_list_table = new $table_class(array('params' => $params));
$pagenum = $wp_list_table->get_pagenum();
$wp_list_table->prepare_items();
$total_pages = $wp_list_table->get_pagination_arg('total_pages');
if ($pagenum > $total_pages && $total_pages > 0) {
$url = add_query_arg('paged', $total_pages);
if (headers_sent()) {
echo FrmAppHelper::js_redirect($url);
} else {
wp_redirect(esc_url_raw($url));
}
die;
}
if (empty($message) && isset($_GET['import-message'])) {
$message = __('Your import is complete', 'formidable');
}
require FrmAppHelper::plugin_path() . '/classes/views/frm-entries/list.php';
}
示例3: get_date_display_value
public static function get_date_display_value($replace_with, $atts)
{
$defaults = array('format' => false);
$atts = wp_parse_args($atts, $defaults);
if (!isset($atts['time_ago'])) {
if (strpos($replace_with, ',')) {
$replace_with = explode(',', $replace_with);
}
if (is_array($replace_with)) {
foreach ($replace_with as $k => $v) {
$replace_with[$k] = self::get_date($v, $atts['format']);
}
} else {
$replace_with = self::get_date($replace_with, $atts['format']);
}
return $replace_with;
}
$replace_with = self::get_date($replace_with, 'Y-m-d H:i:s');
$replace_with = FrmAppHelper::human_time_diff(strtotime($replace_with), strtotime(date_i18n('Y-m-d')));
return $replace_with;
}