Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Last active March 28, 2021 00:27
Show Gist options
  • Save kimcoleman/e2c7d0b709ab6b9bb3d3c86421a7f2b8 to your computer and use it in GitHub Desktop.
Save kimcoleman/e2c7d0b709ab6b9bb3d3c86421a7f2b8 to your computer and use it in GitHub Desktop.
Show today's date before the content of the Terms of Service page at Membership Checkout.
<?php
/**
* Show today's date before the content of the Terms of Service page at Membership Checkout.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
*/
function show_today_date_before_pmpro_tos_content( $pmpro_tos_content, $pmpro_tos ) {
$pmpro_tos_content = '<p>Today is ' . date( get_option( 'date_format' ) ) . '.</p>' . $pmpro_tos_content;
return $pmpro_tos_content;
}
add_filter( 'pmpro_tos_content', 'show_today_date_before_pmpro_tos_content', 10, 2 );
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Show Today’s Date in the Terms of Service Box at Membership Checkout" at Paid Memberships Pro here: https://www.paidmembershipspro.com/show-todays-date-in-the-terms-of-service-box-at-membership-checkout/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment