Method | Description | |
---|---|---|
__construct ( string $title, string $key, array $location, integer $menu_order = 1, array $settings = [] ) | ||
add_brick ( |
||
add_common_field ( string $common_field_array_key, string $key, array $settings = [] ) | ||
add_field ( |
||
add_flexible_content ( |
||
get_setting ( $key, string $default_value = '' ) : string | ||
get_settings ( ) : array | ||
print_settings ( ) | ||
register ( ) | Register a field group. | |
set_setting ( $key, $value ) |
Method | Description | |
---|---|---|
check_keys ( $fields ) | Checks for duplicate keys. This functions hould not be called in a production environment since it will cause wp_die if a duplicate key is found and will also slow down performance by looping lots of multidimensional arrays. | |
get_hide_on_screen_settings ( boolean | array $names_of_items_to_hide = false, boolean | array $names_of_items_to_show = false ) : array | This function hides and/or removes items on the edit screen for where the field group is present. | |
get_rabbit_hole_array_key ( array $field_settings ) : boolean | string | ||
save_json ( ) | Write settings to json file | |
set_unique_keys ( $fields, $base_key ) : mixed | In order to create unique keys, we prepend teh key of a parent to its kids and so on down the field settings tree. |
public __construct ( string $title, string $key, array $location, integer $menu_order = 1, array $settings = [] ) | ||
$title | string | The text to be displayed as title to the administrator. |
$key | string | This must be unique across the site. A god idea is to use the current time and then add a random character. Like so: 1509011031t for September 1st, 2015 @ 10:31. |
$location | array | Where the field group should be displayed. |
$menu_order | integer | Where the field group should be positioned. |
$settings | array | This allows us to set any setting that a field group can have. See $base_settins for available options. |
public add_common_field ( string $common_field_array_key, string $key, array $settings = [] ) | ||
$common_field_array_key | string | A key corresponding to an item in the fewbricks_common_fields array |
$key | string | A site wide unique key for the field |
$settings | array | Anye extra settings to set on the field. Can be used to override existing settings as well. |
public add_flexible_content ( |
||
$flexible_content | ||
return |
public get_setting ( $key, string $default_value = '' ) : string | ||
$key | ||
$default_value | string | |
return | string |