Created
June 24, 2015 07:28
-
-
Save slimndap/31f1d1d6d5a2c4256f0c to your computer and use it in GitHub Desktop.
Adds a new 'Doors open' field to the event editor. For a more information see: http://www.slimndap.com/a-new-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
/** | |
* 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