BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 2
    Kevin on #53428

    I changed the code but get an php error when calling the page afterwards:

    Fatal error: Uncaught TypeError: date(): Argument #2 ($timestamp) must be of type ?int, string given in \wp-content\plugins\buddypress\bp-core\bp-core-functions.php:1775 Stack trace: #0 \wp-content\plugins\buddypress\bp-core\bp-core-functions.php(1775): date(‘Y-m-d H:i:s’, ‘2024-10-29 19:1…’) #1 \wp-includes\class-wp-hook.php(324):

  • Participant
    Level: Initiated
    Posts: 2
    Kevin on #53350

    When I hardcode it like this (just change gmt to false it works) so hopefully you are able to correct my filter:

    
    function bp_core_current_time( $gmt = false, $type = 'mysql' ) {
    
    	/**
    	 * Filters the current GMT time to save into the DB.
    	 *
    	 * @since 1.2.6
    	 *
    	 * @param string $value Current GMT time.
    	 */
    	return apply_filters( 'bp_core_current_time', current_time( $type, $gmt ) );
    }
    

    Might this be a bp bug because my wp timezone was set to my local timezone – same for UTC plus offset – and I found other non resolved ancient posts on this?
    https://buddypress.org/support/topic/activity-wall-time-setting/
    https://buddypress.org/support/topic/possible-solution-found-every-single-time-stamp-on-my-site-is-off-by-7-hours/page/3/