bp_nouveau_get_message_date (美元的日期date_format美元

得到消息的日期。

描述

文件:bp-templates / bp-nouveau / /信息/显然也包括

函数bp_nouveau_get_message_date($date) {$now = bp_core_current_time(true, 'timestamp');$date = strtotime($date);$now_date = getdate($now);$date_date = getdate($date);$compare = array_diff($date_date, $now_date);$ date_format = Y / m / d ';//如果设置,使用Timezone字符串。$timezone_string = bp_get_option('timezone_string');如果(!空($timezone_string)) {$timezone_object = timezone_open($timezone_string); $datetime_object = date_create( "@{$date}" ); $timezone_offset = timezone_offset_get( $timezone_object, $datetime_object ) / HOUR_IN_SECONDS; // Fall back on less reliable gmt_offset } else { $timezone_offset = bp_get_option( 'gmt_offset' ); } // Calculate time based on the offset $calculated_time = $date + ( $timezone_offset * HOUR_IN_SECONDS ); // use M j for all, will revisit this later // if ( empty( $compare['mday'] ) && empty( $compare['mon'] ) && empty( $compare['year'] ) ) { // $date_format = 'H:i'; // } elseif ( empty( $compare['mon'] ) || empty( $compare['year'] ) ) { // $date_format = 'M j'; // } $date_format = 'M j'; /** * Filters the message date for BuddyPress Nouveau display. * * @since BuddyPress 3.0.0 * * @param string $value Internationalization-ready formatted date value. * @param mixed $calculated_time Calculated time. * @param string $date Date value. * @param string $date_format Format to convert the calcuated date to. */ return apply_filters( 'bp_nouveau_get_message_date', date_i18n( $date_format, $calculated_time, true ), $calculated_time, $date, $date_format ); }

更新日志

更新日志
版本 描述
BuddyPress 3.0.0 介绍了。

问题吗?

我们总是很乐意帮助您解决代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队