Свойство | Тип | Описание | |
---|---|---|---|
$types | array | Types of entries to associate with. |
Метод | Описание | |
---|---|---|
get_item_label ( integer $id, string $type, string $subtype = '' ) : string | Used to get the label of an item. | |
get_object_edit_link ( string $type, integer $id ) : string | Retrieve the edit link of a particular object. | |
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 backbone template for the relationship items. | |
process_value ( ) | Converts the database values into a usable associative array. | |
set_post_type ( string $post_type ) | Deprecated way to set the types. | |
set_types ( array $types ) | Modify the types. | |
to_json ( boolean $load ) : mixed | Convert the field data into JSON representation. |
public get_options ( ) : array | ||
Результат | 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. |
Результат | 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 process_value ( ) |
public set_post_type ( string $post_type ) | ||
$post_type | string | Post type |
protected array $types | ||
Результат | array |