Properties

$_custom_field_rules

$_custom_field_rules : array

In-memory representation of the custom field mapping rules

Type

array — { Items by ID. Key $$ID is an index number starting with 1. @type array $$ID { Rule elements. @type integer $post_ID Rule ID; equal to $$ID. @type string $rule_name Rule name, to accomodate an old bug. @type string $name Custom field name the rule applies to. @type string $data_source Data source name, 'none', 'meta' or 'template'. @type string $meta_name if ( $data_source = 'meta' ) attachment metadata element name, if ( $data_source = 'template ) template value w/o "template:" @type string $format Output format, 'native', 'commas' or 'raw'. @type string $option Output option, 'text', 'single'. 'array' or 'multi'. @type boolean $keep_existing Retain existing value(s), do not replace them. @type boolean $no_null Delete empty (NULL) values. @type boolean $mla_column Display the field as a Media/Assistant submenu table column. @type boolean $quick_edit Add the field to the Media/Assistant submenu table Quick Edit area. @type boolean $bulk_edit Add the field to the Media/Assistant submenu table Bulk Edit area. @type boolean $inline_edit OBSOLETE - no longer used. @type boolean $active True if rule should be applied during mapping. @type boolean $read_only True if rule_name !== name, to prevent editing of "old bug" rules. @type boolean $changed True if the rule has changed since loading. @type boolean $deleted True if the rule has been deleted since loading. }

$_custom_field_rule_highest_ID

$_custom_field_rule_highest_ID : integer

Highest existing custom field rule ID value

Type

integer

Methods

mla_put_custom_field_rules()

mla_put_custom_field_rules() 

Flush the in-memory representation of the custom field rules to the option value

mla_count_custom_field_rules()

mla_count_custom_field_rules(  $request) : integer

Get the total number of MLA custom_field_rule objects

Parameters

$request

Returns

integer —

Number of MLA custom_field_rule objects

mla_query_custom_field_rules()

mla_query_custom_field_rules(  $request,   $offset,   $count) : array

Retrieve MLA custom_field_rule objects for list table display

Parameters

$request
$offset
$count

Returns

array —

MLA custom_field_rule objects

mla_find_custom_field_rule_ID()

mla_find_custom_field_rule_ID(string  $rule_name) : integer

Find a Custom Field Rule ID given its rule name

Parameters

string $rule_name

MLA Custom Field Rule name.

Returns

integer —

Rule ID if the rule exists else zero (0).

mla_custom_field_rule_names()

mla_custom_field_rule_names() : array

Return the custom field rule names

Returns

array —

MLA custom_field_rule name => name

mla_find_custom_field_rule()

mla_find_custom_field_rule(integer  $ID) : array

Find a Custom Field Rule given its ID

Parameters

integer $ID

MLA Custom Field Rule ID

Returns

array —

MLA custom_field_rule array

mla_convert_custom_field_rules()

mla_convert_custom_field_rules(  $rule_ids) : array

Convert a Custom Field Rule to an old-style mapping rule, given its ID

Parameters

$rule_ids

Returns

array —

MLA custom_field_mapping values (can be empty)

mla_update_custom_field_rule()

mla_update_custom_field_rule(integer  $ID, string  $key, string  $value) : boolean

Update a Custom Field Rule property given its ID and key.

Parameters

integer $ID

MLA Custom Field Rule ID.

string $key

MLA Custom Field Rule property.

string $value

MLA Custom Field Rule new value.

Returns

boolean —

true if object exists else false.

mla_replace_custom_field_rule()

mla_replace_custom_field_rule(array  $value) : boolean

Replace a Custom Field Rule given its value array.

Parameters

array $value

MLA Custom Field Rule new value.

Returns

boolean —

true if object exists else false.

mla_add_custom_field_rule()

mla_add_custom_field_rule(array  $value) : boolean

Insert a Custom Field Rule given its value array.

Parameters

array $value

MLA Custom Field Rule new value.

Returns

boolean —

true if addition succeeds else false.

mla_tabulate_custom_field_items()

mla_tabulate_custom_field_items(  $s = '') : array

Tabulate MLA custom_field_rule objects by view for list table display

Parameters

$s

Returns

array —

( 'singular' label, 'plural' label, 'count' of items )

_sort_uname_callback()

_sort_uname_callback(array  $a, array  $b) : integer

Callback to sort array by a 'name' key.

Parameters

array $a

The first array.

array $b

The second array.

Returns

integer —

The comparison result.

_get_custom_field_rules()

_get_custom_field_rules(boolean  $force_refresh = false) : boolean

Assemble the in-memory representation of the custom field rules

Parameters

boolean $force_refresh

Optional. Force a reload of rules. Default false.

Returns

boolean —

Success (true) or failure (false) of the operation

_prepare_custom_field_rules_query()

_prepare_custom_field_rules_query(  $raw_request,   $offset,   $count) : array

Sanitize and expand query arguments from request variables

Parameters

$raw_request
$offset
$count

Returns

array —

revised arguments suitable for query

_execute_custom_field_rules_query()

_execute_custom_field_rules_query(  $request) : array

Query the plugin_examples items

Parameters

$request

Returns

array —

query results; array of MLA post_mime_type objects