Last active
January 22, 2021 03:45
-
-
Save ipokkel/a93ff16c650667172924102873004a32 to your computer and use it in GitHub Desktop.
This recipe adds a custom to the [pmpro_member] shortcode.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This recipe adds a custom to the [pmpro_member] shortcode. | |
* | |
* 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_shortcode_custom_field_1611286235606( $r, $user_id, $field ) { | |
if ( 'user_id' === $field || 'ID' === $field || 'member_id' === $field ) { | |
$r = $user_id; | |
} | |
return $r; | |
} | |
add_filter( 'pmpro_member_shortcode_field', 'my_pmpro_member_shortcode_custom_field_1611286235606', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment