PHP Класс Papi_Core_Property, papi

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$convert_type string The convert type.
$default_value null Default value.
$tab boolean Determine if is in a tab.

Защищенные свойства (Protected)

Свойство Тип Описание
$conditional Papi_Core_Conditional The conditional class.
$default_import_settings array Default import settings.
$default_options array Default options.
$display boolean Display the property in WordPress admin.
$options stdClass Current property options object.
$post_id integer The post id.
$slug_required boolean Determine if the property require a slug or not.
$store Papi_Core_Meta_Store The store that the property works with to get data.

Открытые методы

Метод Описание
__construct ( ) The constructor.
__get ( string $key ) : mixed Get option value dynamic.
__isset ( string $key ) : boolean Check if options value exists or not.
__set ( string $key, mixed $value ) Set options value dynamic.
__toString ( ) : string Get a string representation of the object.
current_user_can ( ) : boolean Determine if the current user has capabilities rights.
delete_value ( string $slug, integer $post_id, string $type ) : boolean Delete value from the database.
disabled ( ) : boolean Determine if the property is disabled or not.
display ( ) : boolean Determine if the property should be displayed.
factory ( ) : null | object Create a new instance of the given type or a empty core property if no type is given.
format_value ( mixed $value, string $slug, integer $post_id ) : mixed Format the value of the property before it's returned to WordPress admin or the site.
get_child_properties ( ) : array Get child properties from items in the settings array.
get_child_property ( string $slug, array $items = [] ) : Papi_Core_Property | null Get child property.
get_convert_type ( ) : string Get convert type.
get_default_settings ( ) : array Get default settings.
get_import_settings ( ) : array Get import settings.
get_meta_type ( ) : string Get meta type from the store or the default one.
get_option ( string $key ) : mixed Get option value.
get_options ( ) : stdClass Get the current property options object.
get_post_id ( ) : integer Get post id.
get_rules ( ) : array Get conditional rules.
get_setting ( string $key, mixed $default = null ) : stdClass Get setting value.
get_settings ( ) : stdClass Get custom property settings.
get_slug ( boolean $remove_prefix = false ) : string Get property slug.
get_store ( ) : Papi_Core_Meta_Store | null Get the store that the property will get data from.
get_value ( ) : mixed Get value, no database connections here.
html_id ( object | string $suffix = '', integer $row = null ) : string Get the html id attribute value.
html_name ( array | object $sub_property = null, integer $row = null ) : string Get html name for property with or without sub property and row number.
import_setting ( string $key, mixed $default = null ) : mixed Get the import settings.
import_settings ( ) : object Get the import settings.
import_value ( mixed $value, string $slug, integer $post_id ) : mixed Import value to the property.
load_value ( mixed $value, string $slug, integer $post_id ) : mixed Change value after it's loaded from the database.
match_slug ( string $slug ) : boolean Match property slug with given slug value.
register ( string $type = 'post' ) : boolean Register property with:
register_meta_sanitize_callback ( mixed $value ) : mixed No need for this in Papi, since this is handle different.
render_ajax_request ( ) Render AJAX request.
render_is_allowed_by_rules ( array $rules = [] ) : boolean Check if the property is allowed to render by the conditional rules.
rest_prepare_value ( mixed $value ) : mixed Prepare property value for REST API response.
set_option ( string $key, mixed $value ) Set property option value.
set_options ( array | object $options = [] ) Set the current property options object.
set_post_id ( integer $post_id ) Set post id.
set_setting ( string $key, mixed $value ) Set property setting value.
set_store ( Papi_Core_Meta_Store $store ) Set the store that the property will get data from.
update_value ( mixed $value, string $slug, integer $post_id ) : mixed Update value before it's saved to the database.

Защищенные методы

Метод Описание
prepare_value ( mixed $value ) : mixed Prepare value before database.
setup_actions ( ) Setup actions.
setup_filters ( ) Setup filters.
setup_options ( mixed $options = [] ) : mixed Setup property options.
setup_options_settings ( stdClass $options ) : stdClass Setup options settings.
setup_options_slug ( stdClass $options ) : string Setup options slug.
setup_properties ( ) Setup properties.

Описание методов

__construct() публичный Метод

The constructor.
public __construct ( )

__get() публичный Метод

Get option value dynamic.
public __get ( string $key ) : mixed
$key string
Результат mixed

__isset() публичный Метод

Check if options value exists or not.
public __isset ( string $key ) : boolean
$key string
Результат boolean

__set() публичный Метод

Set options value dynamic.
public __set ( string $key, mixed $value )
$key string
$value mixed

__toString() публичный Метод

Get a string representation of the object.
public __toString ( ) : string
Результат string

current_user_can() публичный Метод

Determine if the current user has capabilities rights.
public current_user_can ( ) : boolean
Результат boolean

delete_value() публичный Метод

Delete value from the database.
public delete_value ( string $slug, integer $post_id, string $type ) : boolean
$slug string
$post_id integer
$type string
Результат boolean

disabled() публичный Метод

Determine if the property is disabled or not.
public disabled ( ) : boolean
Результат boolean

display() публичный Метод

Determine if the property should be displayed.
public display ( ) : boolean
Результат boolean

factory() публичный статический Метод

Create a new instance of the given type or a empty core property if no type is given.
public static factory ( ) : null | object
Результат null | object

format_value() публичный Метод

Format the value of the property before it's returned to WordPress admin or the site.
public format_value ( mixed $value, string $slug, integer $post_id ) : mixed
$value mixed
$slug string
$post_id integer
Результат mixed

get_child_properties() публичный Метод

Get child properties from items in the settings array.
public get_child_properties ( ) : array
Результат array

get_child_property() публичный Метод

Get child property.
public get_child_property ( string $slug, array $items = [] ) : Papi_Core_Property | null
$slug string
$items array
Результат Papi_Core_Property | null

get_convert_type() публичный Метод

Get convert type.
public get_convert_type ( ) : string
Результат string

get_default_settings() публичный Метод

Get default settings.
public get_default_settings ( ) : array
Результат array

get_import_settings() публичный Метод

Get import settings.
public get_import_settings ( ) : array
Результат array

get_meta_type() публичный Метод

Get meta type from the store or the default one.
public get_meta_type ( ) : string
Результат string

get_option() публичный Метод

Get option value.
public get_option ( string $key ) : mixed
$key string
Результат mixed

get_options() публичный Метод

Get the current property options object.
public get_options ( ) : stdClass
Результат stdClass

get_post_id() публичный Метод

Get post id.
public get_post_id ( ) : integer
Результат integer

get_rules() публичный Метод

Get conditional rules.
public get_rules ( ) : array
Результат array

get_setting() публичный Метод

Get setting value.
public get_setting ( string $key, mixed $default = null ) : stdClass
$key string
$default mixed
Результат stdClass

get_settings() публичный Метод

Get custom property settings.
public get_settings ( ) : stdClass
Результат stdClass

get_slug() публичный Метод

Get property slug.
public get_slug ( boolean $remove_prefix = false ) : string
$remove_prefix boolean
Результат string

get_store() публичный Метод

Get the store that the property will get data from.
public get_store ( ) : Papi_Core_Meta_Store | null
Результат Papi_Core_Meta_Store | null

get_value() публичный Метод

Get value, no database connections here.
public get_value ( ) : mixed
Результат mixed

html_id() публичный Метод

Get the html id attribute value.
public html_id ( object | string $suffix = '', integer $row = null ) : string
$suffix object | string
$row integer
Результат string

html_name() публичный Метод

Get html name for property with or without sub property and row number.
public html_name ( array | object $sub_property = null, integer $row = null ) : string
$sub_property array | object
$row integer
Результат string

import_setting() публичный Метод

Get the import settings.
public import_setting ( string $key, mixed $default = null ) : mixed
$key string
$default mixed
Результат mixed

import_settings() публичный Метод

Get the import settings.
public import_settings ( ) : object
Результат object

import_value() публичный Метод

Import value to the property.
public import_value ( mixed $value, string $slug, integer $post_id ) : mixed
$value mixed
$slug string
$post_id integer
Результат mixed

load_value() публичный Метод

Change value after it's loaded from the database.
public load_value ( mixed $value, string $slug, integer $post_id ) : mixed
$value mixed
$slug string
$post_id integer
Результат mixed

match_slug() публичный Метод

Match property slug with given slug value.
public match_slug ( string $slug ) : boolean
$slug string
Результат boolean

prepare_value() защищенный Метод

Prepare value before database.
protected prepare_value ( mixed $value ) : mixed
$value mixed
Результат mixed

register() публичный Метод

- register_meta (WP 4.6+)
public register ( string $type = 'post' ) : boolean
$type string
Результат boolean

register_meta_sanitize_callback() публичный Метод

No need for this in Papi, since this is handle different.
public register_meta_sanitize_callback ( mixed $value ) : mixed
$value mixed
Результат mixed

render_ajax_request() публичный Метод

Render AJAX request.
public render_ajax_request ( )

render_is_allowed_by_rules() публичный Метод

Check if the property is allowed to render by the conditional rules.
public render_is_allowed_by_rules ( array $rules = [] ) : boolean
$rules array
Результат boolean

rest_prepare_value() публичный Метод

Prepare property value for REST API response.
public rest_prepare_value ( mixed $value ) : mixed
$value mixed
Результат mixed

set_option() публичный Метод

Set property option value.
public set_option ( string $key, mixed $value )
$key string
$value mixed

set_options() публичный Метод

Set the current property options object.
public set_options ( array | object $options = [] )
$options array | object

set_post_id() публичный Метод

Set post id.
public set_post_id ( integer $post_id )
$post_id integer

set_setting() публичный Метод

Set property setting value.
public set_setting ( string $key, mixed $value )
$key string
$value mixed

set_store() публичный Метод

Set the store that the property will get data from.
public set_store ( Papi_Core_Meta_Store $store )
$store Papi_Core_Meta_Store

setup_actions() защищенный Метод

Setup actions.
protected setup_actions ( )

setup_filters() защищенный Метод

Setup filters.
protected setup_filters ( )

setup_options() защищенный Метод

Setup property options.
protected setup_options ( mixed $options = [] ) : mixed
$options mixed
Результат mixed

setup_options_settings() защищенный Метод

Setup options settings.
protected setup_options_settings ( stdClass $options ) : stdClass
$options stdClass
Результат stdClass

setup_options_slug() защищенный Метод

Setup options slug.
protected setup_options_slug ( stdClass $options ) : string
$options stdClass
Результат string

setup_properties() защищенный Метод

Setup properties.
protected setup_properties ( )

update_value() публичный Метод

Update value before it's saved to the database.
public update_value ( mixed $value, string $slug, integer $post_id ) : mixed
$value mixed
$slug string
$post_id integer
Результат mixed

Описание свойств

$conditional защищенное свойство

The conditional class.
protected Papi_Core_Conditional $conditional
Результат Papi_Core_Conditional

$convert_type публичное свойство

The convert type.
public string $convert_type
Результат string

$default_import_settings защищенное свойство

Default import settings.
protected array $default_import_settings
Результат array

$default_options защищенное свойство

Default options.
protected array $default_options
Результат array

$default_value публичное свойство

Default value.
public null $default_value
Результат null

$display защищенное свойство

Display the property in WordPress admin.
protected bool $display
Результат boolean

$options защищенное свойство

Current property options object.
protected stdClass $options
Результат stdClass

$post_id защищенное свойство

The post id.
protected int $post_id
Результат integer

$slug_required защищенное свойство

Determine if the property require a slug or not.
protected bool $slug_required
Результат boolean

$store защищенное свойство

The store that the property works with to get data.
protected Papi_Core_Meta_Store $store
Результат Papi_Core_Meta_Store

$tab публичное свойство

Determine if is in a tab.
public bool $tab
Результат boolean