X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f9001779751f83dc8a10e478bfecb4d8dd5f964c..9c2096d803812dacbdf6cf8efe90053e39f00b96:/wp-admin/includes/theme.php diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 80e96741..7cb5dc4a 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -16,10 +16,19 @@ function current_theme_info() { $themes = get_themes(); $current_theme = get_current_theme(); + + if ( ! $themes ) { + $ct = new stdClass; + $ct->name = $current_theme; + return $ct; + } + if ( ! isset( $themes[$current_theme] ) ) { delete_option( 'current_theme' ); $current_theme = get_current_theme(); } + + $ct = new stdClass; $ct->name = $current_theme; $ct->title = $themes[$current_theme]['Title']; $ct->version = $themes[$current_theme]['Version']; @@ -163,7 +172,7 @@ function get_allowed_themes() { * * @since 1.5.0 * - * @return array Key is template name, Value is template name + * @return array Key is the template name, value is the filename of the template */ function get_page_templates() { $themes = get_themes(); @@ -181,6 +190,9 @@ function get_page_templates() { if ( false !== strpos($basename, '/') ) continue; + if ( 'functions.php' == $basename ) + continue; + $template_data = implode( '', file( $template )); $name = ''; @@ -268,6 +280,7 @@ function get_theme_feature_list() { 'black' => __( 'Black' ), 'blue' => __( 'Blue' ), 'brown' => __( 'Brown' ), + 'gray' => __( 'Gray' ), 'green' => __( 'Green' ), 'orange' => __( 'Orange' ), 'pink' => __( 'Pink' ), @@ -296,26 +309,30 @@ function get_theme_feature_list() { ), __( 'Features' ) => array( - 'blavatar' => __( 'Blavatar' ), - 'buddypress' => __( 'BuddyPress' ), - 'custom-background' => __( 'Custom Background' ), - 'custom-colors' => __( 'Custom Colors' ), - 'custom-header' => __( 'Custom Header' ), - 'custom-menu' => __( 'Custom Menu' ), - 'editor-style' => __( 'Editor Style' ), - 'front-page-post-form' => __( 'Front Page Posting' ), - 'microformats' => __( 'Microformats' ), - 'sticky-post' => __( 'Sticky Post' ), - 'theme-options' => __( 'Theme Options' ), - 'threaded-comments' => __( 'Threaded Comments' ), - 'translation-ready' => __( 'Translation Ready' ), - 'rtl-language-support' => __( 'RTL Language Support' ) + 'blavatar' => __( 'Blavatar' ), + 'buddypress' => __( 'BuddyPress' ), + 'custom-background' => __( 'Custom Background' ), + 'custom-colors' => __( 'Custom Colors' ), + 'custom-header' => __( 'Custom Header' ), + 'custom-menu' => __( 'Custom Menu' ), + 'editor-style' => __( 'Editor Style' ), + 'featured-image-header' => __( 'Featured Image Header' ), + 'featured-images' => __( 'Featured Images' ), + 'front-page-post-form' => __( 'Front Page Posting' ), + 'full-width-template' => __( 'Full Width Template' ), + 'microformats' => __( 'Microformats' ), + 'post-formats' => __( 'Post Formats' ), + 'rtl-language-support' => __( 'RTL Language Support' ), + 'sticky-post' => __( 'Sticky Post' ), + 'theme-options' => __( 'Theme Options' ), + 'threaded-comments' => __( 'Threaded Comments' ), + 'translation-ready' => __( 'Translation Ready' ) ), __( 'Subject' ) => array( - 'holiday' => __( 'Holiday' ), + 'holiday' => __( 'Holiday' ), 'photoblogging' => __( 'Photoblogging' ), - 'seasonal' => __( 'Seasonal' ) + 'seasonal' => __( 'Seasonal' ) ) ); @@ -393,9 +410,9 @@ function themes_api($action, $args = null) { if ( is_wp_error($request) ) { $res = new WP_Error('themes_api_failed', __('An Unexpected HTTP Error occurred during the API request.'), $request->get_error_message() ); } else { - $res = unserialize($request['body']); + $res = unserialize( wp_remote_retrieve_body( $request ) ); if ( ! $res ) - $res = new WP_Error('themes_api_failed', __('An unknown error occurred.'), $request['body']); + $res = new WP_Error('themes_api_failed', __('An unknown error occurred.'), wp_remote_retrieve_body( $request ) ); } } //var_dump(array($args, $res));