PHP Class Papi_Property_Relationship, papi

Inheritance: extends Papi_Property
Show file Open project: wp-papi/papi

Public Properties

Property Type Description
$convert_type string The convert type.
$default_value array The default value.

Public Methods

Method Description
format_value ( mixed $values, string $slug, integer $post_id ) : array Format the value of the property before it's returned to WordPress admin or the site.
get_default_settings ( ) : array Get default settings.
get_sort_option ( integer $post_id ) : string Get sort option value.
get_sort_options ( ) : array Get sort options for relationship property.
html ( ) Render property html.
import_value ( mixed $value, string $slug, integer $post_id ) : mixed Import value to the property.
load_value ( mixed $values, string $slug, integer $post_id ) : mixed Change value after it's loaded from the database.
sort_value ( array $values, string $slug, integer $post_id ) : array Sort the values.
update_value ( mixed $values, string $slug, integer $post_id ) : string Sort the values on update.

Protected Methods

Method Description
convert_post_to_item ( WP_Post $post ) : object Convert WordPress post object to a item object.
get_items ( stdClass $settings ) : array Get items to display from settings.

Method Details

convert_post_to_item() protected method

Convert WordPress post object to a item object.
protected convert_post_to_item ( WP_Post $post ) : object
$post WP_Post
return object

format_value() public method

Format the value of the property before it's returned to WordPress admin or the site.
public format_value ( mixed $values, string $slug, integer $post_id ) : array
$values mixed
$slug string
$post_id integer
return array

get_default_settings() public method

Get default settings.
public get_default_settings ( ) : array
return array

get_items() protected method

Get items to display from settings.
protected get_items ( stdClass $settings ) : array
$settings stdClass
return array

get_sort_option() public method

Get sort option value.
public get_sort_option ( integer $post_id ) : string
$post_id integer
return string

get_sort_options() public static method

Get sort options for relationship property.
public static get_sort_options ( ) : array
return array

html() public method

Render property html.
public html ( )

import_value() public method

Import value to the property.
public import_value ( mixed $value, string $slug, integer $post_id ) : mixed
$value mixed
$slug string
$post_id integer
return mixed

load_value() public method

Change value after it's loaded from the database.
public load_value ( mixed $values, string $slug, integer $post_id ) : mixed
$values mixed
$slug string
$post_id integer
return mixed

sort_value() public method

Sort the values.
public sort_value ( array $values, string $slug, integer $post_id ) : array
$values array
$slug string
$post_id integer
return array

update_value() public method

Sort the values on update.
public update_value ( mixed $values, string $slug, integer $post_id ) : string
$values mixed
$slug string
$post_id integer
return string

Property Details

$convert_type public property

The convert type.
public string $convert_type
return string

$default_value public property

The default value.
public array $default_value
return array