Italian (Italy)
Knowledge Base  >  Vik Restaurants  >  Hooks  >  Campi  >  Load Types

do_action_ref_array( 'vikrestaurants_load_custom_fields_types', array &$types )

Fires while fetching the list of available custom fields types.


Description

Trigger hook to allow external plugins to support additional types for the custom fields.

New types have to be appended to the given associative array. The key of the array is the unique ID of the type, the value is a readable name of the type.

All the values included within the $types array will be reported as accepted options of the Type dropdown under the management page of a custom field.


Parameters

&$types

(array)  An associative array holding all the supported types.


Example

The example below adds support for a new "Radio Buttons" input type.

/**
 * Trigger hook to allow external plugins to support custom types.
 * New types have to be appended to the given associative array.
 * The key of the array is the unique ID of the type, the value is
 * a readable name of the type.
 *
 * @param  array  &$types  An array of types.
 */
add_action('vikrestaurants_load_custom_fields_types', function(&$types) {
    $types['radio'] = 'Radio Buttons';
});

Changelog

Version Description
1.3 Introduced.
Ultimo aggiornamento: 2023-12-28
Utile?
Potrebbe interessarti:
This site uses cookies. By continuing to browse you accept their use. Further information