Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Adds a new 'Doors open' field to the event editor. For a more information see: http://www.slimndap.com/a-new-event-editor/.
/**
* Adds a 'Doors open' field to the event editor.
*
* Prepends the new field by filtering the current fields of the event editor
* using the 'wpt/event_editor/fields' hook.
*
* @param array $fields The current fields of the event editor.
* @param int $event_id The ID of the event being edited.
* @return array The new fields of the event editor.
*/
function add_doors_open_field($fields, $event_id) {
array_unshift( $fields, array( 'id' => 'doors_open', 'title' => 'Doors open' ) );
return $fields;
}
add_filter( 'wpt/event_editor/fields', 'add_doors_open_field', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment