Cette page est également disponible en Français Français

If you have the free version of Events Manager which is available on WordPress.org, you don’t have the ability to add custom fields to the register form directly from the admin. This feature is only available for the PRO version of the plugin, but you can easily do it with some hooks! You have to paste the above functions in your theme functions.php file.

For this purpose, we need 4 hooks ; 2 actions and 2 filters.

 

The functions

  • First action hooks the form template to add the additional field. In this example, it is the company name.
  • The second hook is a filter which save the form input value in the database.
  • The third one add the new field to the list of available fields in the admin (when you choose which one to display in the listing view).
  • And the last filter add the field to the table when it is activated in the view (this hook is also used when you export data).
 

As always, you just have to paste these functions in your theme dedicated file, then change the user_company string to what you want.

Sorry, the screenshot is in french

Sorry, the screenshot is in french

After saving everything, you have to open the parameter popup windows and drag & drop the new field on the left of the box to activate it in the table view and in the CSV export.

Voilà! We’re done!

Brice Capobianco

WordPress addict and self-taught. I love to learn and to create, then to share…
Founder of b-website.com