wp_insert_user returns your new user’s ID, if created successful. You can add the user_meta to this ID:
$userid = wp_insert_user( $userdata );
if ( !is_wp_error( $userid ) ) { // check if insert was successful
add_user_meta( $userid, 'verification_ref', $ref ); // add the meta
} else {
/* Error Handling */
}
Related Posts:
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- What process do you use for WordPress development? [closed]
- Why does WordPress use outdated jQuery v1.12.4?
- What is the advantage of using wp_mail?
- Should Plugin Folders Include a Blank index.php File?
- Should I create a theme or a plugin?
- Include third party Javascript library which is not included in WordPress
- Where do I start from
- Check for featured image in WP_Query
- wp_remote_get doesn’t work with secure connections https?
- Authoritative answer on which boots first – Plugins or Themes?
- How to Add Font Awesome Icons to WordPress Menus?
- Get file headers in custom file
- Custom theme sufficient or custom plugin neccessary for this feature set?
- How to create custom home page via plugin?
- How to debug WordPress correctly?
- Custom user profile, registration, login page with theme
- Featured Image not showing in admin
- What is better way to use Bootstrap inside admin panel?
- How to add quick edit and bulk edit fields to users admin section
- Whats the difference between blog_info(‘stylesheet_url’) difference get_stylesheet_uri()
- Paging on a future post loop?
- WordPress admin deleted user details not removed in database. How to delete WordPress Users from Database
- What for the tables ending with the meta used in database of wordpress?
- How to check if a stylesheet is already loaded?
- Ensure function has completed before allowing another Ajax call
- Problem with is_active_sidebar?
- Is Dreamweaver CS5 a serious choice for theme/plugin development?
- What allows a template file from plugin to be copied in child theme and overridden?
- WordPress security issue to output data from user input from theme option form
- Change template dynamically
- WordPress add_admin_page not working even parameters are correct?
- Customizer: widget-synced triggers twice
- Change the ‘published on’ text?
- Get Current Menu Location inside Nav_Walker
- Howto: Use Custom Post Types as Submenu Items in Admin
- Extending theme PHP class in plugin
- How to get boolean value from register_meta properly?
- what is the difference between these phares?
- How to limit number of number of categories displayed by categories widget
- Strange Situation When Try To Retrieve Github Gist Using wp_remote_get
- How to hide or rename “X” and “x-child” references in website source?
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Can’t change the style of a submit input type? [closed]
- Template directory in plugin
- How can I add a simple custom field to my plugin?
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- unable to wp_enqueue_script(‘suggest’);
- Drawing the line between theme & plugin on large scale bespoke projects
- Apply styles to blockquote element with the WYSIWYG editor
- Associate multiple email addresses with the same user account, so they can log in with either
- How to add plugin options in wp editor page
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Update a user profile via frontend
- Create fixed static pages
- Setting a post’s category
- rewrite_rules problem
- Why does website stretch and white space on load? [duplicate]
- Why my theme’s css not working on another site
- How to show comments from different Plugins to same post type?
- Catching a GET parameter from the URL and save it in the user meta when a user registers
- How to make premium plugin? I want to limit it until verification
- Google Web Core Vitals – management, how to in wordpress and advice
- How to add quick edit on the list of users to edit custom fields?
- Impossible to declare box-shadow with wp.customize?
- Override category archive page title (not the head title)
- Metabox types list
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Rate limiting ajax requests in WordPress
- How to hide/remvoe unnecessary field/section in post edit section ( Dashboard )
- Scripts/styles not loading on cloned WP Site when logged in
- WordPress function is not called and ajax return 0
- Is it possible to modify an Elated plugin portfolio-list template in such a way that it will not conflict with future plugin updates?
- Post Pagination does not working on WP-Query
- Plugin MySQL SELECT custom data and filter on user meta
- How to CRUD from wordpress database in wordpress theme?
- Woocommerce Custom Checkout
- Dynamic sidebar areas not working on the Theme Customizer
- Caption Shortcode: what filter to change the image size?
- Merge Codes using redux framework
- Issue on Getting Images URL of the Post Gallery
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- variable created in page.php is null inside of header.php
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- Adding class to the parent of current-post-ancestor / current-menu-parent / current-post-parent
- Updating Style From WP Options Setting Page
- Create and style menu
- append code after the_content not working
- Problem with Poedit [closed]
- Is Explicit Versioning a better alternative to Semantic Versioning for wordpress?
- Invalid Menu Items
- How to get the value entered in the input field in wordpres
- How are themes and plugins localized using the gettext GNU framework?
- Theme, Plugin or Both?
- How to get custom user meta by id in custom Gutenberg block
- Hook a search form anywhere on the site, using a custom plugin
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?
- How to customize password reset message page on success if no error in password reset
- useBlockProps() nests wrapper with class name inside block wrapper in the editor
- WordPress Block with Interactivity API e Preact Component