| @@ -1,0 +1,350 @@ | ||
| 1 | +# Here is the list of all the HOOKS triggered by the plugin | |
| 2 | + | |
| 3 | +## PAYMENTS | |
| 4 | + | |
| 5 | +#### payment_before_admin_params_vikbooking | |
| 6 | +`do_action('payment_before_admin_params_vikbooking', JPayment $payment)` | |
| 7 | + | |
| 8 | +##### Parameters | |
| 9 | +- **$payment** (JPayment) | |
| 10 | +The payment object that has been instantiated (passed by reference). | |
| 11 | + | |
| 12 | +##### Description | |
| 13 | +Plugins can manipulate the properties of this object. | |
| 14 | +Fires before the configuration array is generated. | |
| 15 | + | |
| 16 | +`@since 1.0.6` | |
| 17 | + | |
| 18 | +--- | |
| 19 | + | |
| 20 | +#### payment_after_admin_params_vikbooking | |
| 21 | +`do_action('payment_after_admin_params_vikbooking', JPayment $payment, array $config)` | |
| 22 | + | |
| 23 | +##### Parameters | |
| 24 | +- **$payment** (JPayment) | |
| 25 | +The payment object that has been instantiated (passed by reference). | |
| 26 | +- **$config** (array) | |
| 27 | +The configuration array (passed by reference). | |
| 28 | + | |
| 29 | +##### Description | |
| 30 | +Plugins can manipulate the configuration form of the payment. | |
| 31 | +Fires after generating the form that will be used as configuration. | |
| 32 | + | |
| 33 | +`@since 1.0.6` | |
| 34 | + | |
| 35 | +--- | |
| 36 | + | |
| 37 | +#### payment_before_begin_transaction_vikbooking | |
| 38 | +`do_action('payment_before_begin_transaction_vikbooking', JPayment $payment)` | |
| 39 | + | |
| 40 | +##### Parameters | |
| 41 | +- **$payment** (JPayment) | |
| 42 | +The payment object that has been instantiated (passed by reference). | |
| 43 | + | |
| 44 | +##### Description | |
| 45 | +Plugins can manipulate the properties of this object. | |
| 46 | +Fires before the payment form is initiated. | |
| 47 | + | |
| 48 | +`@since 1.0.6` | |
| 49 | + | |
| 50 | +--- | |
| 51 | + | |
| 52 | +#### payment_after_begin_transaction_vikbooking | |
| 53 | +`do_action('payment_after_begin_transaction_vikbooking', JPayment $payment, string $html)` | |
| 54 | + | |
| 55 | +##### Parameters | |
| 56 | +- **$payment** (JPayment) | |
| 57 | +The payment object that has been instantiated (passed by reference). | |
| 58 | +- **$html** (string) | |
| 59 | +The resulting HTML form (passed by reference). | |
| 60 | + | |
| 61 | +##### Description | |
| 62 | +Plugins can manipulate the generated HTML form. | |
| 63 | +Fires after generating the HTML payment form. | |
| 64 | + | |
| 65 | +`@since 1.0.6` | |
| 66 | + | |
| 67 | +--- | |
| 68 | + | |
| 69 | +#### payment_before_validate_transaction_vikbooking | |
| 70 | +`do_action('payment_before_validate_transaction_vikbooking', JPayment $payment)` | |
| 71 | + | |
| 72 | +##### Parameters | |
| 73 | +- **$payment** (JPayment) | |
| 74 | +The payment object that has been instantiated (passed by reference). | |
| 75 | + | |
| 76 | +##### Description | |
| 77 | +Plugins can manipulate the properties of this object. | |
| 78 | +Fires before the payment transaction is validated. | |
| 79 | + | |
| 80 | +`@since 1.0.6` | |
| 81 | + | |
| 82 | +--- | |
| 83 | + | |
| 84 | +#### payment_after_validate_transaction_vikbooking | |
| 85 | +`do_action('payment_after_validate_transaction_vikbooking', JPayment $payment, JPaymentStatus $status, mixed $response)` | |
| 86 | + | |
| 87 | +##### Parameters | |
| 88 | +- **$payment** (JPayment) | |
| 89 | +The payment object that has been instantiated (passed by reference). | |
| 90 | +- **$status** (JPaymentStatus) | |
| 91 | +The object containing the status information about the transaction (passed by reference). | |
| 92 | +- **$response** (mixed) | |
| 93 | +An object containing the final response (passed by reference). | |
| 94 | +If not manipulated, this value will be NULL. | |
| 95 | + | |
| 96 | +##### Description | |
| 97 | +Plugins can manipulate the response object to return. | |
| 98 | +By filling the `&$response` variable, this method will return it instead of the | |
| 99 | +default `&$status` one. | |
| 100 | +Fires after validating the payment transaction. | |
| 101 | + | |
| 102 | +`@since 1.0.6` | |
| 103 | + | |
| 104 | +--- | |
| 105 | + | |
| 106 | +#### payment_on_after_validation_vikbooking | |
| 107 | +`do_action('payment_on_after_validation_vikbooking', JPayment $payment, boolean $res)` | |
| 108 | + | |
| 109 | +##### Parameters | |
| 110 | +- **$payment** (JPayment) | |
| 111 | +The payment object that has been instantiated (passed by reference). | |
| 112 | +- **$res** (boolean) | |
| 113 | +The result of the transaction (*true* when verified, *false* on failure). | |
| 114 | + | |
| 115 | +##### Description | |
| 116 | +Plugins can manipulate the properties of this object. | |
| 117 | +Fires before the payment process is completed. | |
| 118 | + | |
| 119 | +`@since 1.0.6` | |
| 120 | + | |
| 121 | +--- | |
| 122 | + | |
| 123 | +#### load_payment_gateway_vikbooking | |
| 124 | +`do_action_ref_array('load_payment_gateway_vikbooking', array $drivers, string $payment)` | |
| 125 | + | |
| 126 | +##### Parameters | |
| 127 | +- **$drivers** (array) | |
| 128 | +A list of supported drivers (passed by reference). | |
| 129 | +- **$payment** (string) | |
| 130 | +The name of the gateway to load. | |
| 131 | + | |
| 132 | +##### Description | |
| 133 | +Trigger action to obtain a list of classnames of the payment gateway. | |
| 134 | +The action should autoload the file that contains the classname. | |
| 135 | +In case the payment should be loaded, the classname MUST be | |
| 136 | +pushed within the `&$drivers` array. | |
| 137 | +Fires before the instantiation of the returned classname. | |
| 138 | + | |
| 139 | +`@since 1.0.5` | |
| 140 | + | |
| 141 | +--- | |
| 142 | + | |
| 143 | +### get_supported_payments_vikbooking | |
| 144 | +`apply_filters('get_supported_payments_vikbooking', array $drivers)` | |
| 145 | + | |
| 146 | +##### Parameters | |
| 147 | +- **$drivers** (array) | |
| 148 | +An array containing the list of the supported payments. | |
| 149 | + | |
| 150 | +##### Description | |
| 151 | +Hook used to filter the list of all the supported drivers. | |
| 152 | +Every plugin attached to this filter will be able to push one | |
| 153 | +or more gateways within the `$drivers` array. | |
| 154 | + | |
| 155 | +It is also possible to manipulate the elements in the array, | |
| 156 | +for example to detach a deprecated payment. | |
| 157 | + | |
| 158 | +`@since 1.0.5` | |
| 159 | + | |
| 160 | +--- | |
| 161 | + | |
| 162 | +### vikbooking_oconfirm_payment_logo | |
| 163 | +`apply_filters('vikbooking_oconfirm_payment_logo', array $logo)` | |
| 164 | + | |
| 165 | +##### Parameters | |
| 166 | +- **$logo** (array) | |
| 167 | +An array containing the following keys: | |
| 168 | +`name` the payment name; | |
| 169 | +`path` the payment path; | |
| 170 | +`uri` the payment logo image URI. | |
| 171 | + | |
| 172 | +##### Description | |
| 173 | +Hook used to filter the array containing the logo's information. | |
| 174 | +By default, the array contains the standard path and URI, related | |
| 175 | +to the payment folder of the plugin. | |
| 176 | + | |
| 177 | +Plugins attached to this hook are able to filter the payment logo in case | |
| 178 | +the image is stored somewhere else. | |
| 179 | + | |
| 180 | +`@since 1.0.5` | |
| 181 | + | |
| 182 | +--- | |
| 183 | + | |
| 184 | +## SYSTEM | |
| 185 | + | |
| 186 | +#### vikbooking_before_dispatch | |
| 187 | +`do_action('vikbooking_before_dispatch')` | |
| 188 | + | |
| 189 | +##### Description | |
| 190 | +Fires before the controller of VikBooking is dispatched. | |
| 191 | +Useful to require libraries and to check user global permissions. | |
| 192 | + | |
| 193 | +`@since 1.0.0` | |
| 194 | + | |
| 195 | +--- | |
| 196 | + | |
| 197 | +#### vikbooking_after_dispatch | |
| 198 | +`do_action('vikbooking_after_dispatch')` | |
| 199 | + | |
| 200 | +##### Description | |
| 201 | +Fires after the controller of VikBooking is dispatched. Useful to include | |
| 202 | +web resources (CSS and JS). In case the controller terminates the process | |
| 203 | +(exit or die), this hook won't be fired. | |
| 204 | + | |
| 205 | +`@since 1.0.0` | |
| 206 | + | |
| 207 | +--- | |
| 208 | + | |
| 209 | +#### vikbooking_before_display_{VIEW} | |
| 210 | +`do_action('vikbooking_before_dispatch_' . $view)` | |
| 211 | + | |
| 212 | +##### Description | |
| 213 | +Fires before the controller of VikBooking displays the requested {VIEW}. | |
| 214 | + | |
| 215 | +`@since 1.2.0` | |
| 216 | + | |
| 217 | +--- | |
| 218 | + | |
| 219 | +#### vikbooking_after_display_{VIEW} | |
| 220 | +`do_action('vikbooking_after_dispatch_' . $view)` | |
| 221 | + | |
| 222 | +##### Description | |
| 223 | +Fires after the controller of VikBooking has displayed the requested {VIEW}. | |
| 224 | + | |
| 225 | +`@since 1.2.0` | |
| 226 | + | |
| 227 | +--- | |
| 228 | + | |
| 229 | +## DATABASE | |
| 230 | + | |
| 231 | +#### vik_get_db_prefix | |
| 232 | +`apply_filters('vik_get_db_prefix', string $prefix)` | |
| 233 | + | |
| 234 | +##### Parameters | |
| 235 | +- **$prefix** (string) | |
| 236 | +The database prefix to use for queries. | |
| 237 | + | |
| 238 | +##### Description | |
| 239 | +Hook used to filter the default WP database prefix before it is used. | |
| 240 | + | |
| 241 | +`@since 1.0.6` | |
| 242 | + | |
| 243 | +--- | |
| 244 | + | |
| 245 | +#### vik_db_suppress_errors | |
| 246 | +`apply_filters('vik_db_suppress_errors', boolean $suppress)` | |
| 247 | + | |
| 248 | +##### Parameters | |
| 249 | +- **$suppress** (boolean) | |
| 250 | +True to suppress the errors, false otherwise (false by default). | |
| 251 | + | |
| 252 | +##### Description | |
| 253 | +Hook used to suppress/enable database errors. | |
| 254 | + | |
| 255 | +`@since 1.1.8` | |
| 256 | + | |
| 257 | +--- | |
| 258 | + | |
| 259 | +#### vik_db_show_errors | |
| 260 | +`apply_filters('vik_db_show_errors', boolean $show)` | |
| 261 | + | |
| 262 | +##### Parameters | |
| 263 | +- **$show** (boolean) | |
| 264 | +True to show the errors, false otherwise (true by default). | |
| 265 | + | |
| 266 | +##### Description | |
| 267 | +In case errors are suppressed, this hook would result useless. | |
| 268 | +Errors can be shown only if they are NOT suppressed. | |
| 269 | + | |
| 270 | +`@since 1.1.8` | |
| 271 | + | |
| 272 | +--- | |
| 273 | + | |
| 274 | +## RESOURCES | |
| 275 | + | |
| 276 | +#### vik_before_include_script | |
| 277 | +`apply_filters('vik_before_include_script', boolean true, string $url, string $id, string $version, boolean $footer)` | |
| 278 | + | |
| 279 | +##### Parameters | |
| 280 | +- **$load** (boolean) | |
| 281 | +True to load the resource, false to ignore it. | |
| 282 | +- **$url** (string) | |
| 283 | +The resource URL. | |
| 284 | +- **$id** (string) | |
| 285 | +The script ID attribute. | |
| 286 | +- **$version** (string) | |
| 287 | +The script version, if specified. | |
| 288 | +- **$footer** (string) | |
| 289 | +True whether the script is going to be loaded in the footer. | |
| 290 | + | |
| 291 | +##### Description | |
| 292 | +Hook used to approve/deny the loading of the given script. | |
| 293 | + | |
| 294 | +`@since 1.1.1` | |
| 295 | + | |
| 296 | +--- | |
| 297 | + | |
| 298 | +#### vik_before_include_style | |
| 299 | +`apply_filters('vik_before_include_style', boolean true, string $url, string $id, string $version)` | |
| 300 | + | |
| 301 | +##### Parameters | |
| 302 | +- **$load** (boolean) | |
| 303 | +True to load the resource, false to ignore it. | |
| 304 | +- **$url** (string) | |
| 305 | +The resource URL. | |
| 306 | +- **$id** (string) | |
| 307 | +The stylesheet ID attribute. | |
| 308 | +- **$version** (string) | |
| 309 | +The stylesheet version, if specified. | |
| 310 | + | |
| 311 | +##### Description | |
| 312 | +Hook used to approve/deny the loading of the given stylesheet. | |
| 313 | + | |
| 314 | +`@since 1.1.1` | |
| 315 | + | |
| 316 | +--- | |
| 317 | + | |
| 318 | +## WIDGETS | |
| 319 | + | |
| 320 | +#### vik_widget_before_dispatch_site | |
| 321 | +`do_action_ref_array('vik_widget_before_dispatch_site', array(string $id, JObject &$params))` | |
| 322 | + | |
| 323 | +##### Parameters | |
| 324 | +- **$id** (string) | |
| 325 | +The widget ID (path name). | |
| 326 | +- **&$params** (JObject) | |
| 327 | +The widget configuration registry. | |
| 328 | + | |
| 329 | +##### Description | |
| 330 | +Plugins can manipulate the configuration of the widget at runtime. | |
| 331 | +Fires before dispatching the widget in the front-end. | |
| 332 | + | |
| 333 | +`@since 1.1.3` | |
| 334 | + | |
| 335 | +--- | |
| 336 | + | |
| 337 | +#### vik_widget_after_dispatch_site | |
| 338 | +`do_action_ref_array('vik_widget_after_dispatch_site', array(string $id, string &$html))` | |
| 339 | + | |
| 340 | +##### Parameters | |
| 341 | +- **$id** (string) | |
| 342 | +The widget ID (path name). | |
| 343 | +- **&$html** (string) | |
| 344 | +The HTML of the widget to display. | |
| 345 | + | |
| 346 | +##### Description | |
| 347 | +Plugins can manipulate the configuration of the widget at runtime. | |
| 348 | +Fires before dispatching the widget in the front-end. | |
| 349 | + | |
| 350 | +`@since 1.1.3` | |