MemberPerks mp_cf7_custom_shortcode completa
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 | |
// Add custom shortcodes to Contact Form 7 WP plugin | |
add_action( 'wpcf7_init', 'mp_cf7_custom_shortcode' ); | |
function mp_cf7_custom_shortcode(){ | |
wpcf7_add_form_tag( 'show_member_level', 'cf7_get_member_level' ); | |
} | |
function cf7_get_member_level(){ | |
$memberLevel = mp_get_member_level(); | |
if(empty($memberLevel)): | |
$value = 0; | |
else: | |
$value = $memberLevel['member_level']; | |
endif; | |
return '<input type="hidden" name="member-level" value="'. $value .'" />'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Buenas Tardes David, Tengo una duda este codigo que tu generaste se añade en el functions.php de wordpress???
Quedo atento muchas gracias.