Fieldmanager
  • Package
  • Class
  • Tree
  • Todo

Packages

  • Fieldmanager
    • Context
    • Datasource
    • Field
    • Util
  • None

Classes

  • Fieldmanager_Datasource
  • Fieldmanager_Datasource_Post
  • Fieldmanager_Datasource_Term
  • Fieldmanager_Datasource_User

Class Fieldmanager_Datasource_User

Datasource to populate autocomplete and option fields with WordPress Users.

Fieldmanager_Datasource
Extended by Fieldmanager_Datasource_User
Package: Fieldmanager\Datasource
Located at datasource/class-fieldmanager-datasource-user.php

Methods summary

public
# __construct( mixed $options = array() )

Constructor. Used for validation.

Constructor. Used for validation.

Overrides

Fieldmanager_Datasource::__construct
public integer|string
# get_value( integer $value )

Get a user by the specified field.

Get a user by the specified field.

Parameters

$value
integer
$value post_id

Returns

integer|string

Overrides

Fieldmanager_Datasource::get_value
public array
# get_items( string $fragment = Null )

Get users which match this datasource, optionally filtered by a search fragment, e.g. for Autocomplete.

Get users which match this datasource, optionally filtered by a search fragment, e.g. for Autocomplete.

Parameters

$fragment
string
$fragment

Returns

array
post_id => post_title for display or AJAX

Overrides

Fieldmanager_Datasource::get_items
public string
# get_ajax_action( )

Get an action to register by hashing (non cryptographically for speed) the options that make this datasource unique.

Get an action to register by hashing (non cryptographically for speed) the options that make this datasource unique.

Returns

string
ajax action

Overrides

Fieldmanager_Datasource::get_ajax_action
public string
# presave_alter_values( Fieldmanager_Field $field, array $values, string|integer|null $current_values )

Delete reciprocal user metadata prior to saving (presave will re-add). Reciprocal relationships are not possible if we are not storing by ID.

Delete reciprocal user metadata prior to saving (presave will re-add). Reciprocal relationships are not possible if we are not storing by ID.

Parameters

$field
array
$values new post values
$values
array
$current_values existing post values
$current_values
string|integer|null
$current_value

Returns

string
cleaned value

Overrides

Fieldmanager_Datasource::presave_alter_values
public string
# presave( Fieldmanager_Field $field, string|integer $value, string|integer|null $current_value )

Handle reciprocal usermeta. Reciprocal relationships are not possible if we are not storing by ID.

Handle reciprocal usermeta. Reciprocal relationships are not possible if we are not storing by ID.

Parameters

$field
integer
$value
$value
string|integer
$value
$current_value
string|integer|null
$current_value

Returns

string

Overrides

Fieldmanager_Datasource::presave
public string
# get_view_link( integer $value )

Get view link for a user.

Get view link for a user.

Parameters

$value
integer
$value

Returns

string

Overrides

Fieldmanager_Datasource::get_view_link
public string
# get_edit_link( integer $value )

Get edit link for a user.

Get edit link for a user.

Parameters

$value
integer
$value

Returns

string

Overrides

Fieldmanager_Datasource::get_edit_link

Methods inherited from Fieldmanager_Datasource

autocomplete_search(), get_items_for_ajax(), preload_alter_values()

Magic methods summary

Properties summary

public mixed $query_callback
#

Supply a function which returns a list of users; takes one argument, a possible fragment

Supply a function which returns a list of users; takes one argument, a possible fragment

public array $query_args
#

Arguments to get_users(), which uses WP's defaults.

Arguments to get_users(), which uses WP's defaults.

See

http://codex.wordpress.org/Template_Tags/get_users
public boolean $use_ajax
#

Allow AJAX. If set to false, Autocomplete will pre-load get_items() with no fragment, so False could cause performance problems.

Allow AJAX. If set to false, Autocomplete will pre-load get_items() with no fragment, so False could cause performance problems.

public string $display_property
#

Display property. Defaults to display_name, but can also be 'user_login', 'user_email', or 'user_nicename'

Display property. Defaults to display_name, but can also be 'user_login', 'user_email', or 'user_nicename'

public string $store_property
#

Store property. Defaults to ID, but can also be 'user_login', 'user_email', or 'user_nicename'.

Store property. Defaults to ID, but can also be 'user_login', 'user_email', or 'user_nicename'.

public string $capability
#

Capability required to refer to a user via this datasource.

Capability required to refer to a user via this datasource.

See

http://codex.wordpress.org/Roles_and_Capabilities
public string|Null $reciprocal
#

If not empty, set this object's ID as a value on the user. This is used to establish two-way relationships.

If not empty, set this object's ID as a value on the user. This is used to establish two-way relationships.

Properties inherited from Fieldmanager_Datasource

$ajax_action, $allow_optgroups, $counter, $grouped, $options, $options_callback

Fieldmanager API documentation generated by ApiGen 2.8.0