Simple Fields API Documentation
Class

simple_fields_field_date_v2

class simple_fields_field_date_v2 extends simple_fields_field

Properties

$key
$name
$description
$field_url

Methods

__construct()

string options_output($existing_vals = array())

Output options for the date field We use jquery ui date picker, so we should be able to customize it a bit

options_save()

from simple_fields_field
string edit_output($saved_values, $options)

Output datepicker and timepicker on post edit screen

mixed, edit_save(array $values = null)

Change so saved value is a single one, instead of array, so we can sort by the unixtime in wp_query etc.

set_options_base_id(string $string)

Sets the base for the generation of input ids in options screen Called by options screen.

from simple_fields_field
set_options_base_name($string)

Sets the base for the generation of input names in options screen Called by options screen.

from simple_fields_field
string get_options_id($name $name)

Get the id to use in input or label or similiar to be used in options screen

from simple_fields_field
string get_options_name($name $name)

Get the name to use in input or label or similiar to be used in options screen

from simple_fields_field
get_class_name(string $class)

Return a classname prefixed with simple fields and our field type, to be used in edit post screen Use this to generate class names to make sure they don't collide with other class names in WordPress (from other plugins for example)

from simple_fields_field
return_values($values = null, $parsed_options_for_this_field = null)

Add Extended Return Values and then return the values

enqueue_scripts()

Load scripts and styles

action_admin_head()

Output CSS in admin head

Details

at line 14
public __construct()

at line 69
public string options_output($existing_vals = array())

Output options for the date field We use jquery ui date picker, so we should be able to customize it a bit

Things to inlcude to start with: - Show on click or always - Date format - Default date -

Parameters

$existing_vals

Return Value

string

in simple_fields_field at line 34
public options_save()

at line 212
public string edit_output($saved_values, $options)

Output datepicker and timepicker on post edit screen

Parameters

$saved_values
$options

Return Value

string

at line 378
public mixed, edit_save(array $values = null)

Change so saved value is a single one, instead of array, so we can sort by the unixtime in wp_query etc.

Lets go with ISO8601 instead of unix time. Standards rule, and we can save just time too. Hooray! http://en.wikipedia.org/wiki/ISO8601#Generalprinciples They are sortable too = good. http://stackoverflow.com/questions/9576860/sort-iso-iso-8601-dates-forward-or-backwards http://en.wikipedia.org/wiki/Lexicographicalorder

Parameters

array $values The values that we receive from the post screen. It's the same names as the ones that has been added with $this->getoptionsname()

Return Value

mixed, array or string of values to save in db

in simple_fields_field at line 71
public set_options_base_id(string $string)

Sets the base for the generation of input ids in options screen Called by options screen.

Parameters

string $string

in simple_fields_field at line 80
public set_options_base_name($string)

Sets the base for the generation of input names in options screen Called by options screen.

Parameters

$string

in simple_fields_field at line 89
public string get_options_id($name $name)

Get the id to use in input or label or similiar to be used in options screen

Parameters

$name $name a-z

Return Value

string

in simple_fields_field at line 98
public string get_options_name($name $name)

Get the name to use in input or label or similiar to be used in options screen

Parameters

$name $name a-z

Return Value

string

in simple_fields_field at line 107
public get_class_name(string $class)

Return a classname prefixed with simple fields and our field type, to be used in edit post screen Use this to generate class names to make sure they don't collide with other class names in WordPress (from other plugins for example)

Parameters

string $class Name of class to append

at line 428
public return_values($values = null, $parsed_options_for_this_field = null)

Add Extended Return Values and then return the values

Parameters

$values
$parsed_options_for_this_field

at line 26
public enqueue_scripts()

Load scripts and styles

at line 47
public action_admin_head()

Output CSS in admin head