Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MemberPerks mp_cf7_custom_shortcode completa
<?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 .'" />';
}
@johnedisong

This comment has been minimized.

Copy link

@johnedisong johnedisong commented Dec 6, 2018

Buenas Tardes David, Tengo una duda este codigo que tu generaste se añade en el functions.php de wordpress???

Quedo atento muchas gracias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.