PHP 클래스 PodsForm, pods

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

공개 프로퍼티들

프로퍼티 타입 설명
$field string
$field_group string
$field_type string
$field_types array
$form_counter integer
$loaded array

보호된 프로퍼티들

프로퍼티 타입 설명
$instance PodsForm

공개 메소드들

메소드 설명
admin_init ( ) Run admin_init methods for each field type
attributes ( $attributes, $name = null, $type = null, $options = null ) Output a field's attributes
block_field_types ( ) : array Get list of available text field types
clean ( $input, $noarray = false, $db_field = false ) Clean a value for use in class / id
comment ( string $name, string $message = null, array $options = null ) : string Output a Field Comment Paragraph
data ( $data, $name = null, $type = null, $options = null ) Output a field's data (for use with jQuery)
date_field_types ( ) : array Get list of available date field types
default_value ( $value, $type = 'text', $name = null, $options = null, $pod = null, $id = null ) Parse the default the value
delete ( string $type, integer $id = null, string $name = null, array $options = null, array $pod = null ) Delete the value from the DB
dependencies ( array $options, string $prefix = '' ) : string Setup dependency / exclusion classes
display ( $type, mixed $value = null, string $name = null, array $options = null, array $pod = null, integer $id = null, array $traverse = null ) Change the way the value of the field is displayed with Pods::get
field ( string $name, mixed $value, string $type = 'text', array $options = null, array $pod = null, integer $id = null ) : string Output a field
field_loader ( string $field_type, string $file = '' ) : string Autoload a Field Type's class
field_method ( ) : mixed Run a method from a Field Type's class
field_setup ( null $field = null, null $core_defaults = null, null $type = null ) : array | null Get options for a field and setup defaults
field_types ( ) : array Get a list of all available field types and include
fields_setup ( null $fields = null, null $core_defaults = null, boolean $single = false ) : array | null Get options for a field and setup defaults
file_field_types ( ) : array Get list of available file field types
init ( ) : PodsForm Singleton handling for a basic pods_form() request
label ( string $name, string $label, string $help = '', array $options = null ) : string Output a field's label
merge_attributes ( $attributes, $name = null, $type = null, $options = null, $classes = '' ) Merge attributes and handle classes
number_field_types ( ) : array Get list of available number field types
options ( $type, $options ) : array Setup options for a field and store them for later use
options_setup ( $type = null, $options = null ) : array | null Get options for a field type and setup defaults
permission ( $type, null $name = null, null $options = null, null $fields = null, null $pod = null, null $id = null, null $params = null ) Check if a user has permission to be editing a field
pre_save ( string $type, mixed $value, integer $id = null, string $name = null, array $options = null, array $fields = null, array $pod = null, object $params = null ) Change the value or perform actions after validation but before saving to the DB
prepare ( $type, $options ) : mixed | void Setup value preparation for sprintf
regex ( $type, $options ) : mixed | void Setup regex for JS / PHP
register_field_type ( string $type, string $file = null ) : array Add a new Pod field type
repeatable_field_types ( ) : array Get list of available repeatable field types
row ( string $name, mixed $value, string $type = 'text', array $options = null, array $pod = null, integer $id = null ) : string Output a row (label, field, and comment)
save ( string $type, mixed $value, integer $id = null, string $name = null, array $options = null, array $fields = null, array $pod = null, object $params = null ) Save the value to the DB
simple_tableless_objects ( ) : array Get list of available text field types
submit_button ( string $text = null, string $type = 'primary large', string $name = 'submit', boolean $wrap = true, array | string $other_attributes = null ) Returns a submit button, with provided text and appropriate class, copied from WP Core for use on the frontend
tableless_field_types ( ) : array Get list of available tableless field types
text_field_types ( ) : array Get list of available text field types
ui_options ( $type ) : array | null Get Admin options for a field type and setup defaults
validate ( string $type, mixed $value, string $name = null, array $options = null, array $fields = null, array $pod = null, integer $id = null, array | object $params = null ) Validate a value before it's saved
value ( $type, mixed $value = null, string $name = null, array $options = null, array $pod = null, integer $id = null, array $traverse = null ) Change the value of the field

보호된 메소드들

메소드 설명
field_db ( $name, $value = null, $options = null ) Output field type 'db'
field_hidden ( $name, $value = null, $options = null ) Output a hidden field

비공개 메소드들

메소드 설명
__clone ( ) Prevent clones
__construct ( ) : PodsForm Master handler for all field / form methods

메소드 상세

admin_init() 공개 메소드

Run admin_init methods for each field type
부터: 2.3
public admin_init ( )

attributes() 공개 정적인 메소드

Output a field's attributes
부터: 2.0
public static attributes ( $attributes, $name = null, $type = null, $options = null )

block_field_types() 공개 정적인 메소드

Get list of available text field types
부터: 2.3
public static block_field_types ( ) : array
리턴 array Text field types

clean() 공개 정적인 메소드

Clean a value for use in class / id
부터: 2.0
public static clean ( $input, $noarray = false, $db_field = false )

comment() 공개 정적인 메소드

Output a Field Comment Paragraph
부터: 2.0
public static comment ( string $name, string $message = null, array $options = null ) : string
$name string Field name
$message string Field comments
$options array Field options
리턴 string Comment HTML

data() 공개 정적인 메소드

Output a field's data (for use with jQuery)
부터: 2.0
public static data ( $data, $name = null, $type = null, $options = null )

date_field_types() 공개 정적인 메소드

Get list of available date field types
부터: 2.3
public static date_field_types ( ) : array
리턴 array Date field types

default_value() 공개 정적인 메소드

Parse the default the value
부터: 2.0
public static default_value ( $value, $type = 'text', $name = null, $options = null, $pod = null, $id = null )

delete() 공개 정적인 메소드

Delete the value from the DB
부터: 2.3
public static delete ( string $type, integer $id = null, string $name = null, array $options = null, array $pod = null )
$type string
$id integer
$name string
$options array
$pod array

dependencies() 공개 정적인 메소드

Setup dependency / exclusion classes
부터: 2.0
public static dependencies ( array $options, string $prefix = '' ) : string
$options array array( 'depends-on' => ..., 'excludes-on' => ...)
$prefix string
리턴 string

display() 공개 정적인 메소드

Change the way the value of the field is displayed with Pods::get
부터: 2.0
public static display ( $type, mixed $value = null, string $name = null, array $options = null, array $pod = null, integer $id = null, array $traverse = null )
$value mixed
$name string
$options array
$pod array
$id integer
$traverse array

field() 공개 정적인 메소드

Output a field
부터: 2.0
public static field ( string $name, mixed $value, string $type = 'text', array $options = null, array $pod = null, integer $id = null ) : string
$name string Field name
$value mixed Field value
$type string Field type
$options array Field options
$pod array Pod data
$id integer Item ID
리턴 string Field HTML

field_db() 보호된 정적인 메소드

Used for field names and other places where only [a-z0-9_] is accepted
부터: 2.0
protected static field_db ( $name, $value = null, $options = null )

field_hidden() 보호된 정적인 메소드

Output a hidden field
protected static field_hidden ( $name, $value = null, $options = null )

field_loader() 공개 정적인 메소드

Autoload a Field Type's class
부터: 2.0
public static field_loader ( string $field_type, string $file = '' ) : string
$field_type string Field Type indentifier
$file string The Field Type class file location
리턴 string

field_method() 공개 정적인 메소드

Run a method from a Field Type's class
부터: 2.0
public static field_method ( ) : mixed
리턴 mixed

field_setup() 공개 정적인 메소드

Get options for a field and setup defaults
부터: 2.0
public static field_setup ( null $field = null, null $core_defaults = null, null $type = null ) : array | null
$field null
$core_defaults null
$type null
리턴 array | null

field_types() 공개 정적인 메소드

Get a list of all available field types and include
부터: 2.3
public static field_types ( ) : array
리턴 array Registered Field Types data

fields_setup() 공개 정적인 메소드

Get options for a field and setup defaults
부터: 2.0
public static fields_setup ( null $fields = null, null $core_defaults = null, boolean $single = false ) : array | null
$fields null
$core_defaults null
$single boolean
리턴 array | null

file_field_types() 공개 정적인 메소드

Get list of available file field types
부터: 2.3
public static file_field_types ( ) : array
리턴 array File field types

init() 공개 정적인 메소드

Singleton handling for a basic pods_form() request
부터: 2.3.5
public static init ( ) : PodsForm
리턴 PodsForm

label() 공개 정적인 메소드

Output a field's label
부터: 2.0
public static label ( string $name, string $label, string $help = '', array $options = null ) : string
$name string Field name
$label string Label text
$help string Help text
$options array Field options
리턴 string Label HTML

merge_attributes() 공개 정적인 메소드

Merge attributes and handle classes
부터: 2.0
public static merge_attributes ( $attributes, $name = null, $type = null, $options = null, $classes = '' )

number_field_types() 공개 정적인 메소드

Get list of available number field types
부터: 2.3
public static number_field_types ( ) : array
리턴 array Number field types

options() 공개 정적인 메소드

Setup options for a field and store them for later use
부터: 2.0
public static options ( $type, $options ) : array
$type
$options
리턴 array

options_setup() 공개 정적인 메소드

Get options for a field type and setup defaults
부터: 2.0
public static options_setup ( $type = null, $options = null ) : array | null
$type
리턴 array | null

permission() 공개 정적인 메소드

Check if a user has permission to be editing a field
부터: 2.0
public static permission ( $type, null $name = null, null $options = null, null $fields = null, null $pod = null, null $id = null, null $params = null )
$type
$name null
$options null
$fields null
$pod null
$id null
$params null

pre_save() 공개 정적인 메소드

Change the value or perform actions after validation but before saving to the DB
부터: 2.0
public static pre_save ( string $type, mixed $value, integer $id = null, string $name = null, array $options = null, array $fields = null, array $pod = null, object $params = null )
$type string
$value mixed
$id integer
$name string
$options array
$fields array
$pod array
$params object

prepare() 공개 정적인 메소드

Setup value preparation for sprintf
부터: 2.0
public static prepare ( $type, $options ) : mixed | void
$type
$options
리턴 mixed | void

regex() 공개 정적인 메소드

Setup regex for JS / PHP
부터: 2.0
public static regex ( $type, $options ) : mixed | void
$type
$options
리턴 mixed | void

register_field_type() 공개 정적인 메소드

Add a new Pod field type
부터: 2.3
public static register_field_type ( string $type, string $file = null ) : array
$type string The new field type identifier
$file string The new field type class file location
리턴 array Field Type data

repeatable_field_types() 공개 정적인 메소드

Get list of available repeatable field types
부터: 2.3
public static repeatable_field_types ( ) : array
리턴 array Repeatable field types

row() 공개 정적인 메소드

Output a row (label, field, and comment)
부터: 2.0
public static row ( string $name, mixed $value, string $type = 'text', array $options = null, array $pod = null, integer $id = null ) : string
$name string Field name
$value mixed Field value
$type string Field type
$options array Field options
$pod array Pod data
$id integer Item ID
리턴 string Row HTML

save() 공개 정적인 메소드

Save the value to the DB
부터: 2.3
public static save ( string $type, mixed $value, integer $id = null, string $name = null, array $options = null, array $fields = null, array $pod = null, object $params = null )
$type string
$value mixed
$id integer
$name string
$options array
$fields array
$pod array
$params object

simple_tableless_objects() 공개 정적인 메소드

Get list of available text field types
부터: 2.3
public static simple_tableless_objects ( ) : array
리턴 array Text field types

submit_button() 공개 정적인 메소드

Returns a submit button, with provided text and appropriate class, copied from WP Core for use on the frontend
또한 보기: get_submit_button
부터: 3.0
public static submit_button ( string $text = null, string $type = 'primary large', string $name = 'submit', boolean $wrap = true, array | string $other_attributes = null )
$text string The text of the button (defaults to 'Save Changes')
$type string The type of button. One of: primary, secondary, delete
$name string The HTML name of the submit button. Defaults to "submit". If no id attribute is given in $other_attributes below, $name will be used as the button's id.
$wrap boolean True if the output button should be wrapped in a paragraph tag, false otherwise. Defaults to true
$other_attributes array | string Other attributes that should be output with the button, mapping attributes to their values, such as array( 'tabindex' => '1' ). These attributes will be output as attribute="value", such as tabindex="1". Defaults to no other attributes. Other attributes can also be provided as a string such as 'tabindex="1"', though the array format is typically cleaner.

tableless_field_types() 공개 정적인 메소드

Get list of available tableless field types
부터: 2.3
public static tableless_field_types ( ) : array
리턴 array Tableless field types

text_field_types() 공개 정적인 메소드

Get list of available text field types
부터: 2.3
public static text_field_types ( ) : array
리턴 array Text field types

ui_options() 공개 정적인 메소드

Get Admin options for a field type and setup defaults
부터: 2.0
public static ui_options ( $type ) : array | null
$type
리턴 array | null

validate() 공개 정적인 메소드

Validate a value before it's saved
부터: 2.0
public static validate ( string $type, mixed $value, string $name = null, array $options = null, array $fields = null, array $pod = null, integer $id = null, array | object $params = null )
$type string
$value mixed
$name string
$options array
$fields array
$pod array
$id integer
$params array | object

value() 공개 정적인 메소드

Change the value of the field
부터: 2.3
public static value ( $type, mixed $value = null, string $name = null, array $options = null, array $pod = null, integer $id = null, array $traverse = null )
$value mixed
$name string
$options array
$pod array
$id integer
$traverse array

프로퍼티 상세

$field 정적으로 공개적으로 프로퍼티

static public string $field
리턴 string

$field_group 정적으로 공개적으로 프로퍼티

static public string $field_group
리턴 string

$field_type 정적으로 공개적으로 프로퍼티

static public string $field_type
리턴 string

$field_types 정적으로 공개적으로 프로퍼티

static public array $field_types
리턴 array

$form_counter 정적으로 공개적으로 프로퍼티

static public int $form_counter
리턴 integer

$instance 보호되어 있는 정적으로 프로퍼티

protected static PodsForm $instance
리턴 PodsForm

$loaded 정적으로 공개적으로 프로퍼티

static public array $loaded
리턴 array