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_Term

Datasource to populate autocomplete and option fields with WordPress Terms.

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

Methods summary

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

Constructor

Constructor

Overrides

Fieldmanager_Datasource::__construct
public array
# get_taxonomies( )

Get taxonomies; normalizes $this->taxonomy to an array

Get taxonomies; normalizes $this->taxonomy to an array

Returns

array
of taxonomies
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 array
# preload_alter_values( Fieldmanager_Field $field, array $values )

Unique among FM types, the taxonomy datasource can store data outside FM's array. This is how we add it back into the array for editing.

Unique among FM types, the taxonomy datasource can store data outside FM's array. This is how we add it back into the array for editing.

Parameters

$field
Fieldmanager_Field
$field
$values
array
$values

Returns

array
$values loaded up, if applicable.

Overrides

Fieldmanager_Datasource::preload_alter_values
public int[]
# presave_alter_values( Fieldmanager_Field $field, int[] $values, string|integer|null $current_values )

Presave hook to set taxonomy data

Presave hook to set taxonomy data

Parameters

$field
int[]
$values
$values
int[]
$current_values
$current_values
string|integer|null
$current_value

Returns

int[]
$values

Overrides

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

Sanitize a value

Sanitize a value

Parameters

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

Returns

string
cleaned value

Overrides

Fieldmanager_Datasource::presave
public
# pre_save_taxonomy( mixed[] $tax_values, mixed $field )

Save taxonomy data

Save taxonomy data

Parameters

$tax_values
mixed[]
$tax_values
$field
public array[]
# get_items( mixed $fragment = Null )

Get taxonomy data per $this->taxonomy_args

Get taxonomy data per $this->taxonomy_args

Parameters

$fragment
mixed
$value The value(s) currently set for this field

Returns

array[]
data entries for options

Overrides

Fieldmanager_Datasource::get_items
public string
# get_value( mixed $value )

Translate term id to title, e.g. for autocomplete

Translate term id to title, e.g. for autocomplete

Parameters

$value
mixed
$value

Returns

string

Overrides

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

Get link to view a term

Get link to view a term

Parameters

$value
integer
$value term id

Returns

string

Overrides

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

Get link to edit a term

Get link to edit a term

Parameters

$value
integer
$value term id

Returns

string

Overrides

Fieldmanager_Datasource::get_edit_link

Methods inherited from Fieldmanager_Datasource

autocomplete_search(), get_items_for_ajax()

Magic methods summary

Properties summary

public string|array $taxonomy
#

Taxonomy name or array of taxonomy names

Taxonomy name or array of taxonomy names

public array $taxonomy_args
#

Helper for taxonomy-based option sets; arguments to find terms

Helper for taxonomy-based option sets; arguments to find terms

public boolean $taxonomy_hierarchical
#

Sort taxonomy hierarchically and indent child categories with dashes?

Sort taxonomy hierarchically and indent child categories with dashes?

public integer $taxonomy_hierarchical_depth
#

How far to descend into taxonomy hierarchy (0 for no limit)

How far to descend into taxonomy hierarchy (0 for no limit)

public boolean $append_taxonomy
#

Pass $append = true to wp_set_object_terms?

Pass $append = true to wp_set_object_terms?

public string $taxonomy_save_to_terms
#

If true, additionally save taxonomy terms to WP's terms tables.

If true, additionally save taxonomy terms to WP's terms tables.

public string $only_save_to_taxonomy
#

If true, only save this field to the taxonomy tables, and do not serialize in the FM array.

If true, only save this field to the taxonomy tables, and do not serialize in the FM array.

public boolean $store_term_taxonomy_id
#

If true, store the term_taxonomy_id instead of the term_id

If true, store the term_taxonomy_id instead of the term_id

public boolean $use_ajax
#

Build this datasource using AJAX

Build this datasource using AJAX

Properties inherited from Fieldmanager_Datasource

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

Fieldmanager API documentation generated by ApiGen 2.8.0