Context not working for custom fields
-
Adding the event ID in context does not make the custom fields appear on the indicated event add to cart form. Instead, it removes it entirely.
This is how I had the code:
add_filter( 'mt_custom_fields', 'create_custom_fields', 10, 1 ); function create_custom_fields( $array ) { // Other fields: sanitize callback; input type; input values; display_callback $array['golf_partners'] = array( 'title'=>"FOR GOLFERS - Golf Parnters:", 'sanitize_callback'=>'sanitize_callback', 'display_callback'=>'display_callback', 'input_type'=>'Text', 'context'=> '2', ); $array['game_choice'] = array( 'title'=>"FOR GAMES - Choice of Game", 'sanitize_callback'=>'sanitize_callback', 'display_callback'=>'display_callback', 'input_type'=>'select', 'input_values'=>array( 'None', 'Bridge', 'Mahjong', 'Canasta' ), 'context'=> '2', ); $array['game_partnerss'] = array( 'title'=>"Game Partners:", 'sanitize_callback'=>'sanitize_callback', 'display_callback'=>'display_callback', 'input_type'=>'Text', 'context'=> '2', );
2 is what’s listed as ID in My Calendar events.
If I remove the context line entirely or replace the 2 with ‘global’, the fields show up on all tickets pages.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Context not working for custom fields’ is closed to new replies.