stefiza
Forum Replies Created
-
Forum: Plugins
In reply to: [Responsive Posts Carousel] Creating carousel shortcode for a categoriesThanks!
Forum: Plugins
In reply to: [Responsive Posts Carousel] Creating carousel shortcode for a categoriesIs it possible to exclude a category with this same way?
Forum: Plugins
In reply to: [Responsive Posts Carousel] Random postsok, I got it, sorry!
just add “orderby=rand” to shortcodeok, Thanks!
This was changed in the latest versions because before this data was stored in the “em_events” table in the field em_event_attributes.
This caused a bug in our plugin that took the data from the em_events table.Then at this point the event_attributes field for what is used?
Thanks!
Stefania- This reply was modified 8 years, 6 months ago by stefiza.
Hi,
the problem is just into the table “em_events”.
EM plugin works fine, but I have a function (inside my plugin) that needs to read the field “event_attributes” in “em_events” table.
The events created before the update have this field valued, the events created now have this field null.
The question is just about this field, valued or not.
Thanks
StefaniaThis is what I feared ๐
Thanks anyway!Stefi
Maybe I haven’t understood or I wasn’t able to explain ๐
An user book an event and in our settings for default the status is pending.
In my plugin there is a function that does some operations and at the end must change booking status and send the confirmation mail.How can I submit the function em_booking_set_status from my plugin?
I think that is not possible to hook it by add_filter because the action is called by the event “change status” and not vice versa.
Sorry for my english ๐Ok, I resolved,
I accidentally deleted the code and the function to add fields in the booking-form add_filter(’em_register_form’,’foo’,20);Now the question is:
Is there a way to order the field in the registration form putting my new fields before the standard ones?
Or the only solution is to edit the booking-fields.php file?
Thanks for your patience ๐It works perfectly!
Thanks!!
SteSimply in the booking form there aren’t the custom fields hooked.
The validation works because it returns the message about required fields. Differently em_booking_add doesn’t add fieldsThe first one checks some required fields.
The others add 2 fields in registration forms e save in DB
It worked well before last update[ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]
function em_validate($result, $EM_Booking){ global $pc_users; if(($data = pc_user_logged('id')) == false) { if ($_REQUEST['user_name'] == ''){ $EM_Booking->add_error('Il nome e obbligatorio'); $result = false; } if ($_REQUEST['user_last_name'] == ''){ $EM_Booking->add_error('Il cognome e obbligatorio'); $result = false; } if ($_REQUEST['dbem_phone'] == ''){ $EM_Booking->add_error('Il numero di telefono รจ obbligatorio'); $result = false; } if ($_REQUEST['user_email'] == ''){ $EM_Booking->add_error("L'indirizzo e-mail obbligatorio"); $result = false; } //test se la mail รจ presente tra gli utenti di private content //errore devi loggarti $args = array( 'search' => array( array('key' => 'email', 'operator' => '=', 'val' => $_REQUEST['user_email']) ) ); $utente = $pc_users->get_users($args); if(!empty($utente)) { $EM_Booking->add_error("L'indirizzo e-mail รจ associato ad un utente registrato. Effettuare il login e riprovare la prenotazione"); $result = false; } } return $result; } add_filter('em_booking_validate','em_validate', 1, 2); function bweb_save_custom_event_fields (){ global $EM_Booking ; if( ! empty( $_REQUEST['user_last_name'] ) ){ $EM_Booking->booking_meta['registration']['user_last_name'] = wp_kses( $_REQUEST['user_last_name'], array() ); } if( ! empty( $_REQUEST['user_indirizzo'] ) ){ $EM_Booking->booking_meta['registration']['user_indirizzo'] = wp_kses( $_REQUEST['user_indirizzo'], array() ); } } add_filter('em_booking_add','bweb_save_custom_event_fields'); function bweb_table_custom_event_fields($template, $EM_Bookings_Table){ $template['user_last_name'] = __('Cognome', 'textdomain'); $template['user_indirizzo'] = __('Indirizzo', 'textdomain'); return $template; } add_action('em_bookings_table_cols_template', 'bweb_table_custom_event_fields',10,2); function bweb_display_col_custom_event_fields($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){ if( $col == 'user_last_name' ){ $val = $EM_Booking->get_person()->user_last_name; } if( $col == 'user_indirizzo' ){ $val = $EM_Booking->get_person()->user_indirizzo; } return $val; } add_filter('em_bookings_table_rows_col','bweb_display_col_custom_event_fields', 10, 5);I posted all the functions ๐
Thank’s!
(Sorry for errors I’m posting from mobile)