BSF_Update_Manager::brainstorm_update_themes_transient( obj $_transient_data )
Function to update theme’s transient.
Description
Parameters
- $_transient_data
-
(obj) (Required) Transient Data.
Return
($_transient_data.)
Source
File: admin/bsf-core/class-bsf-update-manager.php
public function brainstorm_update_themes_transient( $_transient_data ) {
global $pagenow;
if ( ! is_object( $_transient_data ) ) {
$_transient_data = new stdClass();
}
if ( 'themes.php' !== $pagenow && 'update-core.php' !== $pagenow ) {
return $_transient_data;
}
$update_data = $this->bsf_update_transient_data( 'themes' );
foreach ( $update_data as $key => $product ) {
if ( false === $this->enable_auto_updates( $product['id'] ) ) {
continue;
}
if ( isset( $product['template'] ) && '' !== $product['template'] ) {
$template = $product['template'];
}
$themes = array();
$themes['theme'] = isset( $template ) ? $template : '';
if ( $this->use_beta_version( $product['id'] ) ) {
$themes['new_version'] = isset( $product['version_beta'] ) ? $product['version_beta'] : '';
} else {
$themes['new_version'] = isset( $product['remote'] ) ? $product['remote'] : '';
}
$themes['url'] = isset( $product['purchase_url'] ) ? $product['purchase_url'] : '';
if ( BSF_License_Manager::bsf_is_active_license( $product['id'] ) === true ) {
$themes['package'] = $this->bsf_get_package_uri( $product['id'] );
} else {
$themes['package'] = '';
$themes['upgrade_notice'] = 'Please activate your license to receive automatic updates.';
}
$_transient_data->last_checked = time();
$_transient_data->response[ $template ] = $themes;
}
return $_transient_data;
}
Expand full source code Collapse full source code View on Trac