+ if ( !is_multisite() ) {
+ if ( ! current_user_can('update_themes') )
+ printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
+ else if ( empty($update['package']) )
+ printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>. <em>Automatic update is unavailable for this theme.</em>') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
+ else
+ printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a> or <a href="%4$s" %5$s>update now</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick );
+ }
+ }
+}
+
+/**
+ * Retrieve list of WordPress theme features (aka theme tags)
+ *
+ * @since 3.1.0
+ *
+ * @param bool $api Optional. Whether try to fetch tags from the WP.org API. Defaults to true.
+ * @return array Array of features keyed by category with translations keyed by slug.
+ */
+function get_theme_feature_list( $api = true ) {
+ // Hard-coded list is used if api not accessible.
+ $features = array(
+ __( 'Colors' ) => array(
+ 'black' => __( 'Black' ),
+ 'blue' => __( 'Blue' ),
+ 'brown' => __( 'Brown' ),
+ 'gray' => __( 'Gray' ),
+ 'green' => __( 'Green' ),
+ 'orange' => __( 'Orange' ),
+ 'pink' => __( 'Pink' ),
+ 'purple' => __( 'Purple' ),
+ 'red' => __( 'Red' ),
+ 'silver' => __( 'Silver' ),
+ 'tan' => __( 'Tan' ),
+ 'white' => __( 'White' ),
+ 'yellow' => __( 'Yellow' ),
+ 'dark' => __( 'Dark' ),
+ 'light' => __( 'Light' ),
+ ),
+
+ __( 'Columns' ) => array(
+ 'one-column' => __( 'One Column' ),
+ 'two-columns' => __( 'Two Columns' ),
+ 'three-columns' => __( 'Three Columns' ),
+ 'four-columns' => __( 'Four Columns' ),
+ 'left-sidebar' => __( 'Left Sidebar' ),
+ 'right-sidebar' => __( 'Right Sidebar' ),
+ ),
+
+ __( 'Width' ) => array(
+ 'fixed-width' => __( 'Fixed Width' ),
+ 'flexible-width' => __( 'Flexible Width' ),
+ ),
+
+ __( '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' ),
+ 'featured-image-header' => __( 'Featured Image Header' ),
+ 'featured-images' => __( 'Featured Images' ),
+ 'flexible-header' => __( 'Flexible Header' ),
+ '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' ),
+ 'photoblogging' => __( 'Photoblogging' ),
+ 'seasonal' => __( 'Seasonal' ),
+ )
+ );
+
+ if ( ! $api || ! current_user_can( 'install_themes' ) )
+ return $features;
+
+ if ( !$feature_list = get_site_transient( 'wporg_theme_feature_list' ) )
+ set_site_transient( 'wporg_theme_feature_list', array( ), 10800);
+
+ if ( !$feature_list ) {
+ $feature_list = themes_api( 'feature_list', array( ) );
+ if ( is_wp_error( $feature_list ) )
+ return $features;
+ }
+
+ if ( !$feature_list )
+ return $features;
+
+ set_site_transient( 'wporg_theme_feature_list', $feature_list, 10800 );