Lisäosan tekijä kehotti tietystä kohtaa eteenpäin tutkimaan functions.php-tiedostoa. Seuraavalla koodilla sain muutettua päiväyksen muodon sellaiseksi kuin se oli ennen lisäosan poistoa:
function bsp_change_freshness_forum ($forum_id = 0 ) {
global $bsp_style_settings_freshness ;
// Verify forum and get last active meta
$forum_id = bbp_get_forum_id( $forum_id );
$last_active = get_post_meta( $forum_id, '_bbp_last_active_time', true );
if ( empty( $last_active ) ) {
$reply_id = bbp_get_forum_last_reply_id( $forum_id );
if ( !empty( $reply_id ) ) {
$last_active = get_post_field( 'post_date', $reply_id );
} else {
$topic_id = bbp_get_forum_last_topic_id( $forum_id );
if ( !empty( $topic_id ) ) {
$last_active = bbp_get_topic_last_active_time( $topic_id );
}
}
}
$last_active = bbp_convert_date( $last_active ) ;
$date_format = 'j.n.Y';
$time_format = 'H:i';
$date= date_i18n( "{$date_format}", $last_active );
$time=date_i18n( "{$time_format}", $last_active );
//check the order
if (!empty ($bsp_style_settings_freshness['date_order'])) {
$first = $time ;
$second = $date ;
}
else {
$first = $date ;
$second = $time ;
}
$separator = (!empty ($bsp_style_settings_freshness['date_separator'] ) ? $bsp_style_settings_freshness['date_separator'] : ' ' ) ;
$active_time = $first.$separator.$second ;
return apply_filters ('bsp_change_freshness_forum' , $active_time) ;
}
//this function changes the bbp freshness data (time since) into a last post date for topics
function bsp_change_freshness_topic ($last_active, $topic_id) {
global $bsp_style_settings_freshness ;
$topic_id = bbp_get_topic_id( $topic_id );
// Try to get the most accurate freshness time possible
$last_active = get_post_meta( $topic_id, '_bbp_last_active_time', true );
if ( empty( $last_active ) ) {
$reply_id = bbp_get_topic_last_reply_id( $topic_id );
if ( !empty( $reply_id ) ) {
$last_active = get_post_field( 'post_date', $reply_id );
} else {
$last_active = get_post_field( 'post_date', $topic_id );
}
}
$last_active = bbp_convert_date( $last_active ) ;
$date_format = 'j.n.Y';
$time_format = 'H:i';
$date= date_i18n( "{$date_format}", $last_active );
$time=date_i18n( "{$time_format}", $last_active );
//check the order
if (!empty ($bsp_style_settings_freshness['date_order'])) {
$first = $time ;
$second = $date ;
}
else {
$first = $date ;
$second = $time ;
}
$separator = (!empty ($bsp_style_settings_freshness['date_separator'] ) ? $bsp_style_settings_freshness['date_separator'] : ' ' ) ;
$active_time = $first.$separator.$second ;
return apply_filters ('bsp_change_freshness_topic' , $active_time) ;
}
add_filter( 'bbp_get_forum_last_active', 'bsp_change_freshness_forum', 10, 2 );
add_filter( 'bbp_get_topic_last_active', 'bsp_change_freshness_topic', 10, 2 );