| 1 |
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?> |
| 2 |
<?php |
| 3 |
|
| 4 |
/** |
| 5 |
***** DO NOT CALL ANY FUNCTIONS DIRECTLY FROM THIS FILE ****** |
| 6 |
* |
| 7 |
* This file will be loaded even before the framework is loaded |
| 8 |
* so the $app is not available here, only declare functions here. |
| 9 |
*/ |
| 10 |
|
| 11 |
|
| 12 |
/** |
| 13 |
* Get the fluent coommunity application instance |
| 14 |
* |
| 15 |
* @param string $module The binding/key name for a component. |
| 16 |
* @param array $parameters constructor dependencies if any. |
| 17 |
* @return \FluentCommunity\Framework\Foundation\Application|mixed |
| 18 |
*/ |
| 19 |
function fluentCommunityApp($module = null, $parameters = []) |
| 20 |
{ |
| 21 |
return \FluentCommunity\App\App::make($module, $parameters); |
| 22 |
} |
| 23 |
|
| 24 |
function fluentCommunitySanitizeArray($array) |
| 25 |
{ |
| 26 |
return array_map(function ($value) { |
| 27 |
return is_array($value) ? fluentCommunitySanitizeArray($value) : sanitize_text_field($value); |
| 28 |
}, $array); |
| 29 |
} |
| 30 |
|