-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.php
More file actions
29 lines (22 loc) · 842 Bytes
/
index.php
File metadata and controls
29 lines (22 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/*
Plugin Name: Themeforest Themes Update
Plugin URI: https://github.com/bitfade/themeforest-themes-update
Description: Updates all themes purchased from themeforest.net
Author: pixelentity
Version: 1.0
Author URI: http://pixelentity.com
*/
// to debug
// set_site_transient('update_themes',null);
function themeforest_themes_update($updates) {
if (isset($updates->checked)) {
require_once("pixelentity-themes-updater/class-pixelentity-themes-updater.php");
$username = defined('THEMEFOREST_USERNAME') ? THEMEFOREST_USERNAME : null;
$apikey = defined('THEMEFOREST_APIKEY') ? THEMEFOREST_APIKEY : null;
$updater = new Pixelentity_Themes_Updater($username,$apikey);
$updates = $updater->check($updates);
}
return $updates;
}
add_filter("pre_set_site_transient_update_themes", "themeforest_themes_update");