Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mikaeljorhult
Created January 16, 2013 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikaeljorhult/4550942 to your computer and use it in GitHub Desktop.
Save mikaeljorhult/4550942 to your computer and use it in GitHub Desktop.
array(
'name' => __( 'Date and time', 'theme' ),
'slug' => 'date_time',
'description' => __( 'Date and time of the event.', 'theme' ),
'type' => 'date_v2',
'type_date_v2_options' => array(
'show_as' => 'datetime',
'show' => 'on_click',
'default_date' => 'today'
)
)
@bonny
Copy link

bonny commented Jan 17, 2013

// Field extensions store their options in the options array, grouped by field key
// It should (and will be in future) added by just using options directly, but for now this is the way it works

array(
    'name' => __( 'Date and time', 'theme' ),
    'slug' => 'date_time',
    'description' => __( 'Date and time of the event.', 'theme' ),
    'type' => 'date_v2',
    "options" => array(
        "date_v2" => array(
            "show" => "on_click",
            "show_as" => "datetime",
            "default_date" => "today"
        )
    )
)

@mikaeljorhult
Copy link
Author

Worked like a charm. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment