PHP 클래스 PodsRESTHandlers, pods

Handlers for reading and writing Pods fields via REST API
부터: 2.5.6
파일 보기 프로젝트 열기: pods-framework/pods 1 사용 예제들

공개 메소드들

메소드 설명
get_handler ( array $object, string $field_name, WP_REST_Request $request, string $object_type ) : mixed Handler for getting custom field data.
pod_extends_core_route ( array | Pods $pod ) : boolean Check if a Pod supports extending core REST response.
post_type_rest_support ( string $post_type_name, boolean | false $rest_base = false, string $controller = 'WP_REST_Posts_Controller' ) Add REST API support to a post type
taxonomy_rest_support ( string $taxonomy_name, boolean | false $rest_base = false, string $controller = 'WP_REST_Terms_Controller' ) Add REST API support to an already registered taxonomy.
write_handler ( mixed $value, object $object, string $field_name, WP_REST_Request $request, string $object_type ) : boolean | integer Handler for updating custom field data.

보호된 메소드들

메소드 설명
get_pod ( $pod_name, $id ) : boolean | Pods Get Pod object

메소드 상세

get_handler() 공개 정적인 메소드

Handler for getting custom field data.
부터: 2.5.6
public static get_handler ( array $object, string $field_name, WP_REST_Request $request, string $object_type ) : mixed
$object array The object from the response
$field_name string Name of field
$request WP_REST_Request Current request
$object_type string Type of object
리턴 mixed

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

Get Pod object
부터: 2.5.6
protected static get_pod ( $pod_name, $id ) : boolean | Pods
$pod_name
$id
리턴 boolean | Pods

pod_extends_core_route() 공개 정적인 메소드

Check if a Pod supports extending core REST response.
부터: 2.5.6
public static pod_extends_core_route ( array | Pods $pod ) : boolean
$pod array | Pods Pod object or the pod_data array
리턴 boolean

post_type_rest_support() 공개 정적인 메소드

Add REST API support to a post type
부터: 2.5.6
public static post_type_rest_support ( string $post_type_name, boolean | false $rest_base = false, string $controller = 'WP_REST_Posts_Controller' )
$post_type_name string Name of post type
$rest_base boolean | false Optional. Base url segment. If not set, post type name is used
$controller string Optional, controller class for route. If not set "WP_REST_Posts_Controller" is used.

taxonomy_rest_support() 공개 정적인 메소드

Add REST API support to an already registered taxonomy.
부터: 2.5.6
public static taxonomy_rest_support ( string $taxonomy_name, boolean | false $rest_base = false, string $controller = 'WP_REST_Terms_Controller' )
$taxonomy_name string Taxonomy name.
$rest_base boolean | false Optional. Base url segment. If not set, taxonomy name is used.
$controller string Optional, controller class for route. If not set "WP_REST_Terms_Controller" is used.

write_handler() 공개 정적인 메소드

Handler for updating custom field data.
부터: 2.5.6
public static write_handler ( mixed $value, object $object, string $field_name, WP_REST_Request $request, string $object_type ) : boolean | integer
$value mixed Value to write
$object object The object from the response
$field_name string Name of field
$request WP_REST_Request Current request
$object_type string Type of object
리턴 boolean | integer