Custom_Fields implements Registerable, Standard_Service

Custom Fields service.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable
Standard_Service

Table of Contents

$providers  : array<string|int, Custom_Fields_Provider>
List of providers that provide custom fields.
add_provider()  : self
Add a provider.
check_permissions()  : bool
Check if the current user can access the cf api.
get_field_display_value()  : mixed
Get the display value of a field from it's provider.
get_field_provider()  : Custom_Fields_Provider
Get the provider of a given field.
get_field_value()  : mixed
Get the value of a field from it's provider.
get_fields()  : array<string|int, mixed>
Get the list of fields.
get_providers()  : array<string|int, Custom_Fields_Provider>
Get the providers.
has_providers()  : bool
Determine if at least one provider has been registered.
print_fields()  : WP_REST_Response
Returns all fields via the rest api.
register()  : void
Register the service.
register_routes()  : void
Register cf api route.

Properties

Methods

check_permissions()

Check if the current user can access the cf api.

public check_permissions() : bool
Return values
bool

get_field_display_value()

Get the display value of a field from it's provider.

public get_field_display_value(string $meta_key, string $option) : mixed
Parameters
$meta_key : string
$option : string
Return values
mixed

get_field_value()

Get the value of a field from it's provider.

public get_field_value(string $meta_key, string|int $post_id) : mixed
Parameters
$meta_key : string
$post_id : string|int
Return values
mixed

get_fields()

Get the list of fields.

public get_fields() : array<string|int, mixed>
Return values
array<string|int, mixed>

has_providers()

Determine if at least one provider has been registered.

public has_providers() : bool
Return values
bool

print_fields()

Returns all fields via the rest api.

public print_fields() : WP_REST_Response
Return values
WP_REST_Response

register()

Register the service.

public register() : void
Return values
void

register_routes()

Register cf api route.

public register_routes() : void
Return values
void

Search results