checked)) return $checked_data; $theme_base = basename(dirname(dirname(__FILE__))); $request = array( 'slug' => $theme_base, 'version' => $checked_data->checked[$theme_base.'/'.$theme_base.'.php'] ); // Start checking for an update $send_for_check = array( 'body' => array( 'action' => 'theme_update', 'request' => serialize($request), 'api-key' => md5(get_bloginfo('url')) // @todo: add username/password check for commercial themes ), 'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url') ); $raw_response = wp_remote_post(THEME_UPDATE_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; } /** * Get the new version update details * * @since 1.2 */ function atom_update_available(&$update_details){ static $themes_update; $theme = get_theme(THEME_NAME); // need to test this if (!isset($themes_update)) $themes_update = get_site_transient('update_themes'); if (is_object($theme) && isset($theme->stylesheet)) $stylesheet = $theme->stylesheet; elseif (is_array($theme) && isset($theme['Stylesheet'])) $stylesheet = $theme['Stylesheet']; else return false; if (isset($themes_update->response[$stylesheet])): $update = $themes_update->response[$stylesheet]; $update_details['theme_name'] = is_object($theme) ? $theme->name : (is_array($theme) ? $theme['Name'] : ''); if(!current_user_can('update_themes') || empty($update->package)) $update_details['update_url'] = wp_nonce_url('update.php?action=upgrade-theme&theme='.urlencode($stylesheet), 'upgrade-theme_'.$stylesheet); $update_details['new_version'] = $update['new_version']; $update_details['details_url'] = add_query_arg(array('TB_iframe' => 'true', 'width' => 1024, 'height' => 800), $update['url']); return true; endif; return false; } /** * Displays a warning message telling the user he shouldn't edit the theme files :) * * @since 1.0 */ function atom_editor_warning(){ global $current_screen; if($current_screen->id == 'theme-editor'): ?>
'._a("User CSS").'', ''._a("Custom Functions").''); ?>
" followAdRules />