/** * Transient update themes filter * * @see https://github.com/WordPress/WordPress/blob/3.7/wp-includes/option.php#L1030 * * @param array $update_themes * @return array */ public function transient_update_themes_filter($update_themes) { if (is_object($update_themes) && isset($update_themes->response) && is_array($update_themes->response)) { $pronamic_themes = pronamic_client_get_themes(); $themes = array(); foreach ($pronamic_themes as $theme) { $checked[$theme->get_stylesheet()] = $theme->get('Version'); $themes[$theme->get_stylesheet()] = array('Name' => $theme->get('Name'), 'Title' => $theme->get('Name'), 'Version' => $theme->get('Version'), 'Author' => $theme->get('Author'), 'Author URI' => $theme->get('AuthorURI'), 'Template' => $theme->get_template(), 'Stylesheet' => $theme->get_stylesheet()); } $options = $this->get_http_api_options(array('themes' => json_encode($themes))); $url = 'http://api.pronamic.eu/themes/update-check/1.1/'; $raw_response = wp_remote_post($url, $options); if (is_wp_error($raw_response) || 200 !== wp_remote_retrieve_response_code($raw_response)) { return $update_themes; } $response = json_decode(wp_remote_retrieve_body($raw_response), true); if (is_array($response) && isset($response['themes'])) { $update_themes->response = array_merge($update_themes->response, $response['themes']); } } return $update_themes; }
?> </tbody> </table> <?php } ?> <h3><?php _e('Themes', 'pronamic_client'); ?> </h3> <?php $pronamic_themes = pronamic_client_get_themes(); if (empty($pronamic_themes)) { ?> <p> <?php _e('No Pronamic themes found.', 'pronamic_client'); ?> </p> <?php } else { ?> <table class="wp-list-table widefat themes" cellspacing="0"> <thead>