-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,232 additions
and
1,206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/** | ||
* File containing an class for general configuration. | ||
* | ||
* @package EightshiftForms\General | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace EightshiftForms\General; | ||
|
||
use EightshiftForms\Hooks\Filters; | ||
use EightshiftFormsVendor\EightshiftLibs\Services\ServiceInterface; | ||
|
||
/** | ||
* Class General | ||
*/ | ||
class General implements ServiceInterface | ||
{ | ||
/** | ||
* Register all hooks. | ||
* | ||
* @return void | ||
*/ | ||
public function register(): void | ||
{ | ||
\add_filter('http_request_args', [$this, 'getHttpRequestArgs']); | ||
} | ||
|
||
/** | ||
* Return http request args. | ||
* | ||
* @param array<int, mixed> $args Arguments from core. | ||
* | ||
* @return array<int, mixed> | ||
*/ | ||
public function getHttpRequestArgs(array $args): array | ||
{ | ||
$args['timeout'] = 30; | ||
|
||
return \apply_filters(Filters::getGeneralSettingsFilterName('httpRequestArgs'), $args); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Filters General | ||
This document will provide you with the code examples for forms filters used in general. | ||
|
||
## Change http request arguments | ||
This filter can be used to change CURL timeout for the file upload if you have to upload large files. | ||
|
||
**Filter name:** | ||
`es_forms_general_http_request_args` | ||
|
||
**Filter example:** | ||
```php | ||
// Return http request args. | ||
add_filter('es_forms_general_http_request_args', [$this, 'getHttpRequestArgs']); | ||
|
||
/** | ||
* Return http request args. | ||
* | ||
* @param array<int, mixed> $args Arguments from core. | ||
* | ||
* @return array<int, mixed> | ||
*/ | ||
public function getHttpRequestArgs(array $args): array | ||
{ | ||
$args['timeout'] = 50; | ||
|
||
return $args; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters