Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5987a6198f
Fetching contributors…

Cannot retrieve contributors at this time

executable file 55 lines (37 sloc) 1.39 kb
<?php
/**/
// TEMP: Enable update check on every request. Normally you don't need this! This is for testing only!
//set_site_transient('update_themes', null);
add_filter('pre_set_site_transient_update_themes', 'check_for_update');
$theme_data = get_theme_data( TEMPLATEPATH . '/style.css');
$theme_version = $theme_data['Version'];
$theme_base = get_option('stylesheet');
/******************Change this*******************/
$api_url = 'http://cyberchimps.com/api/';
/************************************************/
function check_for_update($checked_data) {
global $wp_version, $theme_version, $theme_base, $api_url;
$request = array(
'slug' => $theme_base,
'version' => $theme_version
);
// Start checking for an update
$send_for_check = array(
'body' => array(
'action' => 'theme_update',
'request' => serialize($request),
'api-key' => md5(get_bloginfo('url'))
),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url')
);
$raw_response = wp_remote_post($api_url, $send_for_check);
if (!is_wp_error($raw_response) && ($raw_response['response']['code'] == 200))
$response = unserialize($raw_response['body']);
// Feed the update data into WP updater
if (!empty($response))
$checked_data->response[$theme_base] = $response;
return $checked_data;
}
if (is_admin())
$current = get_transient('update_themes');
?>
Jump to Line
Something went wrong with that request. Please try again.