Custom Data panel now not appearing in admin
-
I think this could be a conflict, but I originally added a custom data field on a test site that worked okay, but having moved the code into another (local) site I found the custom data field still appears at the user end on the form, but the panel has disappeared when I go to modify payments in the admin area (under tickets on the right-hand side).
My code in the functions.php file is pretty much the same on the My Tickets documentation:
function create_custom_fields( $array ) { // Other fields: sanitize callback; input type; input values; display_callback $array['test_event_data'] = array( 'title'=>'Purchaser Name', 'sanitize_callback'=>'sanitize_callback', 'display_callback'=>'display_callback', 'input_type'=>'text', 'context'=> 'global' ); return $array; } add_filter( 'mt_custom_fields', 'create_custom_fields', 10, 1 ); /* 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 ideas would be much appreciated!
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Custom Data panel now not appearing in admin’ is closed to new replies.