Property | Type | Description | |
---|---|---|---|
$allow_duplicates | |||
$max | |||
$post_type |
Method | Description | |
---|---|---|
admin_init ( ) | Admin initialization actions | |
allow_duplicates ( boolean $allow = true ) | Specify whether to allow each entry to be selected multiple times. | |
get_item_label ( integer $id, string $type, string $subtype = '' ) : string | Used to get the label of an item. | |
get_options ( ) : array | Generate the item options for the relationship field. | |
get_title_by_type ( integer $id, string $type, string $subtype = '' ) : string | Used to get the title of an item. | |
item_template ( boolean $display_input = true ) | Serves as a Underscore template for the relationship items. | |
set_max ( integer $max ) | Set the maximum allowed number of selected entries. | |
set_post_type ( string | array $post_type ) | Set the post type of the entries. | |
template ( ) | The main Underscore template of this field. | |
to_json ( boolean $load ) : array | Returns an array that holds the field data, suitable for JSON representation. |
public allow_duplicates ( boolean $allow = true ) | ||
$allow | boolean |
public get_options ( ) : array | ||
return | array | $options The selectable options of the relationship field. |
public get_title_by_type ( integer $id, string $type, string $subtype = '' ) : string | ||
$id | integer | The database ID of the item. |
$type | string | Item type (post, term, user, comment, or a custom one). |
$subtype | string | The subtype - "page", "post", "category", etc. |
return | string | $title The title of the item. |
public item_template ( boolean $display_input = true ) | ||
$display_input | boolean | Whether to display the selected item input field. |
public set_post_type ( string | array $post_type ) | ||
$post_type | string | array | Post type |