Skip to main content

benecaster_get_membership_payments_recorded_since()

Free
benecaster_get_membership_payments_recorded_since(): ?string

Returns the moment this site began recording built-in membership payments. Anything a revenue chart shows before that date was not recorded, so label the chart with it rather than drawing zero.

Return Value

Type: string|null

When this site began recording built-in membership payments, as a UTC Y-m-d H:i:s string, or null if it never has.

Example

$since = benecaster_get_membership_payments_recorded_since();
if ( $since ) {
    printf(
        esc_html__( 'Revenue recorded since %s', 'my-addon' ),
        esc_html( wp_date( get_option( 'date_format' ), strtotime( $since . ' UTC' ) ) )
    );
}

Notes

The date is set once and does not move. Payments from before it are not in benecaster_get_membership_payments() and cannot be added later.

Need this built rather than just documented? See our services →