wpeventmanager / wp-event-manager-migration

Migration from the following plugins The Events Calendar Modern Event Calendar Events manager All-in-One Event Calendar Event Organiser EventON My Calendar Eventum (Tevolution-Events) – Pro Add-on Event Espresso 4 (EE4) GeoDirectory Events – Addon AIT Events (AIT Themes) – Addon In-built Events Management.
1 stars 0 forks source link

Custom field issue #45

Open mistry-jignesh opened 1 year ago

mistry-jignesh commented 1 year ago

Custom field issue. (Organizer,Venues,Event,registration)

I have imported the events file. Now I have changed one field name from Start date to Date.

image


image

Events are imported successfully. Here in the database Date field is available with Date and time.

image

Observed that in the application Start date is missing at the front and backend sides.

image

ritakikani commented 12 months ago

Hello @mistry-jignesh ,

There is no any issue from plugin side, but "Custom Field" is used for override the value of meta_key in database. If you will try to add "Custom Field" then You would have to add meta key in Blank text box which is seen after select "Custom Field" option. Once you will add meta key in given text box then the original meta key of the file will be replaced by the new meta_key added by you. So, in simple term, the value of that field would be stored in database with the same meta_value but the new meta_key added in input box by you.

For example, You had added new meta key "Date" in place of "_start_event_date" in above screenshot. So, In database, _start_event_date will be replaced by the "Date" and value would be as it is. So, In front-end and in back-end, field value for "_event_start_date" seen blank and you have to add code via filter to show custom field called "Date".

You have to add below code to list custom field value added by export field in your theme functions.php file :

`function add_custom_cpt_event_column($columns) { $columns[''] = __('', 'wp-event-manager'); return $columns; } add_filter('wp_event_manager_cpt_event_column', 'add_custom_cpt_event_column');

function add_cpt_event_custom_column($value, $column, $post) { if($column == ''){ $value = get_post_meta($post->ID, $column, true); } return $value; } add_filter('wpem_cpt_event_custom_column', 'add_cpt_event_custom_column', 10, 3);`

In above code, you have to replace the "" with your custom meta_key, and "" with field title.

mistry-jignesh commented 12 months ago

It is working fine. So need to create documentation for this issue.