GravityKit\GravityExport\Save\Addon\SaveAddon
An add-on that provides settings for multiple store methods.
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:28
Details
- Kind:
class - Namespace:
GravityKit\GravityExport\Save\Addon - Extends:
SaveAddonVariables - Implements:
AddonInterface
Properties
| Property | Type | Description |
|---|---|---|
$_capabilities_form_settings | string | Feed settings permissions. |
$_path | string | Relative path to file from plugins directory. |
$_full_path | string | Full path to this file. |
Methods
| Method | Description |
|---|---|
__construct() | |
init() | |
get_menu_icon() | Return the plugin's icon for the plugin/form settings menu. |
get_filename_formats() | Returns an array of default filename formats. |
feed_settings_fields() | Returns the fields set for every feed. |
settings_select() | |
process_feed() | Process the feed on the correct storage type if available. |
get_bulk_actions() | Registers bulk actions for this feed. |
can_duplicate_feed() | |
process_single_action() | |
process_bulk_action() | |
get_action_links() | |
get_column_value() | |
addStorageTypes() | Add multiple storage types. |
addStorageType() | Adds a storage type. |
get_target_path() | Returns the target path for the provided feed. |
get_filename() | Parses the file name used when saving the file. |
get_current_settings() | |
scripts() | |
styles() | |
testConnection() | AJAX-function to test connection. |
getCallbackUrl() | Returns the callback url for this add-on. |
action_save_feed() | Processes the gk/gravityexport/save/action/save-feed action. |
Method Reference
__construct()
public function __construct( StorageService $storage_service, PasswordService $password_service, ConnectionManagerService $connection_manager_service )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$storage_service | StorageService | ||
$password_service | PasswordService | ||
$connection_manager_service | ConnectionManagerService |
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:170
init()
public function init(): void
Returns
void
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:184
get_menu_icon()
public function get_menu_icon(): string
Return the plugin's icon for the plugin/form settings menu.
Returns
string
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:236
get_filename_formats()
public static function get_filename_formats(): array
Returns an array of default filename formats.
Returns
array[]— Array withvalue,label, andtitlekeys.
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:247
feed_settings_fields()
public function feed_settings_fields(): array
Returns the fields set for every feed.
Returns
array[]— The fields.
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:293
settings_select()
public function settings_select( $field, $echo=true ): string
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | |||
$echo | true |
Returns
string
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:671
process_feed()
public function process_feed( $feed, $entry, $form ): void
Process the feed on the correct storage type if available.
Note: this method is called when an entry is submitted. Not when the feed is process manually.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | Feed information. | |
$entry | array | Entry information. | |
$form | array | Form information. |
Returns
void
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:774
get_bulk_actions()
public function get_bulk_actions(): array
Registers bulk actions for this feed.
Returns
array
Since: $ver$
Source: add-ons/save/src/Addon/SaveAddon.php:852
can_duplicate_feed()
public function can_duplicate_feed( $id ): bool
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$id |
Returns
bool
Since: $ver$
Source: add-ons/save/src/Addon/SaveAddon.php:863
process_single_action()
public function process_single_action( $action )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$action |
Since: $ver$
Source: add-ons/save/src/Addon/SaveAddon.php:871
process_bulk_action()
public function process_bulk_action( $action ): void
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$action |
Returns
void
Since: $ver$
Source: add-ons/save/src/Addon/SaveAddon.php:886
get_action_links()
public function get_action_links(): array
Returns
array
Since: $ver$
Source: add-ons/save/src/Addon/SaveAddon.php:987
get_column_value()
public function get_column_value( $item, $column )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$item | |||
$column |
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:1146
addStorageTypes()
public function addStorageTypes( array $storage_types ): void
Add multiple storage types.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$storage_types | StorageTypeInterface[] | The provided storage types. |
Returns
void
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:1195
addStorageType()
public function addStorageType( StorageTypeInterface $storageType ): void
Adds a storage type.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$storageType | StorageTypeInterface | The storage type. |
Returns
void
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:1208
get_target_path()
public static function get_target_path( array $meta, array $feed, array $entry=[] ): string
Returns the target path for the provided feed.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$meta | array | The metadata object. | |
$feed | array | The feed object. | |
$entry | array | [] | the entry object. |
$storage_type | StorageTypeInterface | The storage type. |
Returns
string— The target path.
Since: $ver$
Source: add-ons/save/src/Addon/SaveAddon.php:1230
get_filename()
public static function get_filename( array $feed, ?array $form, ?array $entries=[] ): string
Parses the file name used when saving the file.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | Gravity Forms form feed. | |
$form | array | null | Gravity Forms form array connected to the feed. | |
$entries | array | null | [] | Array of entries being processed (single or many) |
Returns
string
See Also
\StorageService::renderFile()
Source: add-ons/save/src/Addon/SaveAddon.php:1257
get_current_settings()
public function get_current_settings(): ?array
Returns
?array
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:1314
scripts()
public function scripts(): array
Returns
array
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:1341
styles()
public function styles(): array
Returns
array
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:1399
testConnection()
public function testConnection(): void
AJAX-function to test connection.
Returns
void
Since: 1.0
Source: add-ons/save/src/Addon/SaveAddon.php:1422
getCallbackUrl()
public function getCallbackUrl(): string
Returns the callback url for this add-on.
Returns
string— The callback URL.
Since: $ver$
Source: add-ons/save/src/Addon/SaveAddon.php:1603
action_save_feed()
public function action_save_feed( $feed_id=null ): void
Processes the gk/gravityexport/save/action/save-feed action.
This hook can be used to manually trigger the processing of a feed. Useful for plugins like WP Control.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed_id | int | null | null | The feed ID to process. |
Returns
void
Since: $ver$
Source: add-ons/save/src/Addon/SaveAddon.php:1733