PHP Class fewbricks\acf\fields\field

Show file Open project: folbert/fewbricks Class Usage Examples

Protected Properties

Property Type Description
$settings array

Public Methods

Method Description
__construct ( string $label, string $name, string $key, array $base_settings = [], array $custom_settings = [] )
get_setting ( $key, string $default_value = '' ) : string
get_settings ( fewbricks\acf\field-groups | layout | repeater | flexible_content | brick $object_to_get_for ) : array
set_setting ( $key, $value )
set_settings ( $settings )

Private Methods

Method Description
prepare_label ( $object_to_prepare_for )
prepare_label_addition ( repeater | flexible_content | brick $object_to_prepare_for, $setting )
prepare_name ( repeater | flexible_content | brick $object_to_prepare_for )
prepare_settings ( $object_to_prepare_for )

Method Details

__construct() public method

public __construct ( string $label, string $name, string $key, array $base_settings = [], array $custom_settings = [] )
$label string The label that the field will get.
$name string The name that the field will get.
$key string The key that the field wil get. It is very important that this value is unique among all the keys across the entire site.
$base_settings array
$custom_settings array Any custom settings that you want to set. A setting must be implemented in the ACF field class for it to have an effect. This array wil be merged with $base_settings in this class and then with the default settings in the ACF field class.

get_setting() public method

public get_setting ( $key, string $default_value = '' ) : string
$key
$default_value string
return string

get_settings() public method

public get_settings ( fewbricks\acf\field-groups | layout | repeater | flexible_content | brick $object_to_get_for ) : array
$object_to_get_for fewbricks\acf\field-groups | fewbricks\acf\layout | repeater | flexible_content | brick
return array

set_setting() public method

public set_setting ( $key, $value )
$key
$value

set_settings() public method

public set_settings ( $settings )
$settings

Property Details

$settings protected property

protected array $settings
return array