Italian (Italy)

apply_filters( 'vikappointments_create_timeline_parser', string $classname, mixed $search, string $parser )

Fires while instantiating the object used to parse the availability timeline.


Description

This hook can be used to safely change the class instance responsible of generating the availability timeline.

In addition to returning the new class name, plugins must include all the needed resources.

The returned object must also inherit the VAPAvailabilityTimelineParser class. Take a look at the file below to figure out all the abstract methods that should be implemented.

/wp-content/plugins/vikappointments/helpers/libraries/availability/timeline/parser.php

In case of no returned classes, the class matching the identifier defined by $parser argument will be used.


Parameters

$classname

(string)  The classname that will be used to instantiate the timeline parser.

$search

(VAPAvailabilitySearch)  The availability search handler, holding all the query details.

$parser

(string)  The default parser identifier.


Example

The example provides the instantiation of the "Extended" timeline parser, located within the VikWP plugin.

/wp-content/plugins/vikwp/extended.php
/**
 * This hook can be used to safely change the class instance
 * responsible of generating the availability timeline.
 * In addition to returning the new class name, plugins must
 * include all the needed resources. The returned object must
 * also inherit VAPAvailabilityTimelineParser class.
 *
 * @param  string  $classname  The classname of the parser to use.
 * @param  mixed   $search     The search handler.
 * @param  string  $parser     The parser name.
 */
add_filter('vikappointments_create_timeline_parser', function($classname, $search, $parser)
{
    // load class handler
    require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'extended.php';
	
    // return instance name
    return 'VAPAvailabilityTimelineParserExtended';
}, 10, 3);

Changelog

Version Description
1.2 Introduced.
Ultimo aggiornamento: 2021-08-25
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.