PHP 클래스 Papi_Core_Property, papi

파일 보기 프로젝트 열기: wp-papi/papi 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$convert_type string The convert type.
$default_value null Default value.
$tab boolean Determine if is in a tab.

보호된 프로퍼티들

프로퍼티 타입 설명
$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