Italian (Italy)
Knowledge Base  >  Vik Appointments  >  Hook  >  API  >  Init Framework

apply_filters_ref_array( 'vikappointments_init_application_framework', bool $status, VAPApiFramework $api )

Fires while initializing the API framework.


Description

The API framework is used to connect remote applications to VikAppointments and to dispatch specific actions.

Trigger hook to let the plugins alter the application framework. It is possible to use this hook to support third-party actions.

In order to extend the list of supported plugins/actions, it is possible to use the code below.

$api->addIncludePath($path);
$api->addIncludePaths([$path1, $path2, ...]);

This will tell the API framework to load the plugins/actions also from the specified folders.


Parameters

$status

(bool)  True on success, false otherwise.

$api

(VAPApiFramework)  The framework API instance.


Example

The example below adds support for all the plugins/actions contained in a specific folder of a third-party plugin. Such as:

/wp-content/plugins/vikwp/apps/

All the PHP files contained within the apps folder of the VikWP plugin will be loaded.

/** 
 * Trigger event to let the plugins alter the application framework.
 * It is possible to use this event to include third-party applications.
 *
 * @param  boolean          $status  True on success, false otherwise.
 * @param  VAPApiFramework  $api     The framework API instance.
 */
add_filter('vikappointments_init_application_framework', function($status, $api)
{
    // fetch plugins folder path
    $folder = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'apps';

    // include apps folder
    $api->addIncludePath($folder);

    return $status;
}, 10, 2);

Changelog

Version Description
1.2 Introduced.
Ultimo aggiornamento: 2021-10-05
Utile?
Potrebbe interessarti:

Questo sito web utilizza i cookie

Questo sito web utilizza cookie e tecnologie simili. Alcune di queste tecnologie sono necessarie per il corretto funzionamento del sito web (essenziali). Altre tecnologie sono utilizzate per valutare il comportamento degli utenti (analisi), per integrare media esterni o per scopi pubblicitari. Se l'utente accetta, queste tecnologie vengono attivate. I dettagli sono riportati nella Privacy Policy. Da questa stessa pagina è inoltre possibile aggiornare/revocare il consenso. Se non si fornisce il consenso, verranno attivati solo i cookie con funzioni essenziali.

Sul nostro sito web utilizziamo tecnologie provenienti dagli Stati Uniti. Pertanto, se acconsentite, acconsentite anche al trasferimento dei vostri dati negli Stati Uniti. Desideriamo sottolineare che gli Stati Uniti non hanno un livello di protezione dei dati paragonabile a quello dell'Unione Europea e che qualsiasi azienda statunitense può essere obbligata dalle autorità statali a consegnare i vostri dati senza che voi abbiate alcuno strumento efficace di protezione legale contro questo.