Entry ID in User Profile ONLY if Submitted

Est. Reading: 1 minute
By: TechDragon12
Created: 09/29/2017
Difficulty: Intermediate

Entry ID in User Profile ONLY if Submitted

×Warning: This tutorial was created 2589 days ago. Some of the information may be out of date with more recent versions of Formidable. Please proceed with caution and always perform a backup before adding custom code.
---open php---
function show_custom_profile_fields( $user ) {
---close php---

Additional profile information

<input type="text" name="frm_entry_id" id="frm_entry_id" value="---open php--- echo esc_attr( get_the_author_meta( 'frm_entry_id', $user->ID ) ); ---close php---" class="regular-text" />
---open php--- } user_id ) { return; //don't continue if no user } if( FrmProFormsHelper::saving_draft($form_id) ) { return; } else { update_user_meta( $entry->user_id, 'frm_entry_id', $entry_id ); } } } add_action('frm_after_create_entry', 'add_entry_id_to_user', 30, 2); /*SHORTCODE DEPENDING ON THE EXISTENCE OF ENTRY ID*/ function frm_entry_shortcode() { global $current_user; get_currentuserinfo(); if ($current_user) { $usermeta = get_user_meta($current_user->ID, 'frm_entry_id', true); if (is_user_logged_in()) { if(empty($usermeta)) { $listing_link = 'HTML here if NO Entry ID'; } else { $listing_link = 'HTML here if there IS an Entry ID'; } } else { $listing_link = ''; } return $listing_link; } } add_shortcode( 'is_frm_entry', 'frm_entry_shortcode' );

Leave a Reply

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crosschevron-leftchevron-rightarrow-right