Skip to content

Instantly share code, notes, and snippets.

@dparker1005
Created March 8, 2022 16:34
Show Gist options
  • Select an option

  • Save dparker1005/7f9239aa4a1e4d6044224b728dd53b0e to your computer and use it in GitHub Desktop.

Select an option

Save dparker1005/7f9239aa4a1e4d6044224b728dd53b0e to your computer and use it in GitHub Desktop.
Adds a "Member Since:" field to the WP admin profile.
<?php
// Copy from below here...
/**
* Adds a "Member Since:" field to the WP admin profile.
*
* 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 my_pmpro_member_since_profile_field( $user ) {
?>
<table class="form-table">
<tr>
<th>Member Since: </th>
<td><?php echo esc_html( date_i18n( "Y-m-d H:i:s", strtotime( $user->user_registered ) ) ); ?></td>
</tr>
</table>
<?php
}
add_action( 'pmpro_after_membership_level_profile_fields', 'my_pmpro_member_since_profile_field', 5, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment