Removes 'End time' and all tickets field from the event editor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Removes 'End time' and all tickets fields from the event editor. | |
* | |
* @param array $fields The current fields of the event editor. | |
* @param int $event_id The event being edited. | |
* @return array The new fields of the event editor. | |
*/ | |
function remove_event_editor_fields($fields, $event_id) { | |
$new_fields = array(); | |
$remove_fields = array( 'enddate', 'tickets_status', 'tickets_url', 'tickets_button', '_wpt_event_tickets_price' ); | |
foreach ($fields as $field) { | |
if (!in_array($field['id'], $remove_fields)) { | |
$new_fields[] = $field; | |
} | |
} | |
return $new_fields; | |
} | |
add_filter( 'wpt/event_editor/fields', 'remove_event_editor_fields', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment