Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions class-gwiz-gf-code-chest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public function minimum_requirements() {
public function pre_init() {
parent::pre_init();

add_filter( 'expiration_of_transient_wp_github_plugin_updater_gf-code-chest/gf-code-chest.php', array( $this, 'filter_updater_cache_ttl' ), 10, 3 );

$this->init_auto_updater();

/**
Expand All @@ -123,6 +125,29 @@ public function pre_init() {
add_action( 'gform_forms_post_import', array( $this, 'import_feeds_with_form' ) );
}

/**
* Filter the updater release metadata cache TTL.
*
* Defaults to the bundled updater value, unless overridden
* with the `gfcc_updater_cache_ttl` filter.
*
* @param int $expiration Existing transient expiration in seconds.
* @param mixed $value Transient value.
* @param string $transient Transient name.
*
* @return int
*/
public function filter_updater_cache_ttl( $expiration, $value, $transient ) {
$ttl = (int) apply_filters(
'gfcc_updater_cache_ttl',
$expiration,
$value,
$transient
);

return $ttl;
}

/**
* Initialize the auto-updater.
*/
Expand Down