Custom Fields Error
-
Greetings,
I’m encountering the following error after having adding a few custom fields. The error occurs after a completed reservation.
Warning: Illegal string offset ‘event_id’ in /home/ama/public_html/wp-content/plugins/my-tickets/mt-notifications.php on line 323
Warning: Illegal string offset ‘traditional_chicken_piccata’ in /home/ama/public_html/wp-content/plugins/my-tickets/mt-notifications.php on line 324
The error repeats itself for each of the custom fields I’ve created, which is currently only 2. The errors are only occurring on events that do not have the custom fields assigned to them. The event that does have the fields assigned to it is working as intended (ID 310).
Here is the code I’m using to add the custom fields:
function create_custom_fields( $meals ) { // Other fields: sanitize callback; input type; input values; display_callback $meals = array( 'traditional_chicken_piccata' => array( 'title'=>"Traditional Chicken Piccata:", 'sanitize_callback'=>'sanitize_callback', 'display_callback'=>'display_callback', 'input_type'=>'number', 'context'=> '310' ), 'flank_steak_roulade' => array( 'title'=>"Flank Steak Roulade:", 'sanitize_callback'=>'sanitize_callback', 'display_callback'=>'display_callback', 'input_type'=>'number', 'context'=> '310' ) ); return $meals; } /* Display callback formats the saved data. $context is 'payment' or 'cart', depending on whether it appears in an admin payment or the user's shopping cart. */ function display_callback( $data, $context='payment' ) { return urldecode( $data ); } /* Sanitize callback cleans the data before saving to the DB */ function sanitize_callback( $data ) { return esc_sql( $data ); } ?>Any assistance you can provided would be greatly appreciated. Thanks.
The topic ‘Custom Fields Error’ is closed to new replies.