• Roundup WP
  • Products
    • Registrations for the Events Calendar Pro
      • Buy Now
      • Setup (Pro)
      • Demo
    • Stripe Extension
      • Buy Now
      • Setup
    • Mailchimp Extension
      • Buy Now
      • Setup
    • Mollie (iDEAL) Extension
      • Buy Now
      • Setup
    • Discount Codes Extension
      • Buy Now
      • Setup
  • Support
    • FAQs and Troubleshooting
    • Codex
    • Contact Support
  • My Account
  • Get Pro

Filter: rtec_user_data

Posted on February 11, 2015

rtec_user_data is a filter for dynamically assigning user data for use in form fields.

Usage

<?php add_filter( 'rtec_user_data', 'function_name' ); ?>

Changelog

Pro
2.5 – introduced

Example: Dynamically Set User Data to Pre-Populate Form Field

Step 1) Create a form field of the type “text” and record the input field name

Step 2) Use this code making sure the array keys match (in our example, “profile-field”). If you are trying to use information from the “usermeta” database table, replace “the_meta_key” with the relevan key for your user meta.

function ru_addtional_user_data( $user_data, $user_meta ) {

	$user_data['profile-field'] = isset( $user_meta['the_meta_key'] ) ? $user_meta['the_meta_key'][0] : '';

	return $user_data;
}
add_filter( 'rtec_user_data', 'ru_addtional_user_data', 10, 2 );
Registrations for the Events Calendar Pro logo
Learn about the plugin our users are raving about Unmatched customer support from WordPress experts. Learn More