Changeset 38075 for trunk/src/wp-admin/includes/import.php
- Timestamp:
- 07/17/2016 03:31:29 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/import.php
r34566 r38075 127 127 128 128 $locale = get_locale(); 129 $popular_importers = get_site_transient( 'popular_importers_' . $locale ); 129 $cache_key = 'popular_importers_' . md5( $locale . $wp_version ); 130 $popular_importers = get_site_transient( $cache_key ); 130 131 131 132 if ( ! $popular_importers ) { 132 $url = add_query_arg( 'locale', get_locale(), 'http://api.wordpress.org/core/importers/1.1/' ); 133 $url = add_query_arg( array( 134 'locale' => get_locale(), 135 'version' => $wp_version, 136 ), 'http://api.wordpress.org/core/importers/1.1/' ); 133 137 $options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url() ); 134 138 $response = wp_remote_get( $url, $options ); 135 139 $popular_importers = json_decode( wp_remote_retrieve_body( $response ), true ); 136 140 137 if ( is_array( $popular_importers ) ) 138 set_site_transient( 'popular_importers_' . $locale, $popular_importers, 2 * DAY_IN_SECONDS );139 else141 if ( is_array( $popular_importers ) ) { 142 set_site_transient( $cache_key, $popular_importers, 2 * DAY_IN_SECONDS ); 143 } else { 140 144 $popular_importers = false; 145 } 141 146 } 142 147 … … 158 163 'blogger' => array( 159 164 'name' => __( 'Blogger' ), 160 'description' => __( 'I nstall the Blogger importer to import posts, comments, and users from a Blogger blog.' ),165 'description' => __( 'Import posts, comments, and users from a Blogger blog.' ), 161 166 'plugin-slug' => 'blogger-importer', 162 167 'importer-id' => 'blogger', … … 164 169 'wpcat2tag' => array( 165 170 'name' => __( 'Categories and Tags Converter' ), 166 'description' => __( ' Install the category/tag converter to convert existing categories to tags or tags to categories, selectively.' ),171 'description' => __( 'Convert existing categories to tags or tags to categories, selectively.' ), 167 172 'plugin-slug' => 'wpcat2tag-importer', 168 173 'importer-id' => 'wp-cat2tag', … … 170 175 'livejournal' => array( 171 176 'name' => __( 'LiveJournal' ), 172 'description' => __( 'I nstall the LiveJournal importer to import posts from LiveJournal using their API.' ),177 'description' => __( 'Import posts from LiveJournal using their API.' ), 173 178 'plugin-slug' => 'livejournal-importer', 174 179 'importer-id' => 'livejournal', … … 176 181 'movabletype' => array( 177 182 'name' => __( 'Movable Type and TypePad' ), 178 'description' => __( 'I nstall the Movable Type importer to import posts and comments from a Movable Type or TypePad blog.' ),183 'description' => __( 'Import posts and comments from a Movable Type or TypePad blog.' ), 179 184 'plugin-slug' => 'movabletype-importer', 180 185 'importer-id' => 'mt', … … 182 187 'opml' => array( 183 188 'name' => __( 'Blogroll' ), 184 'description' => __( 'I nstall the blogroll importer to import links in OPML format.' ),189 'description' => __( 'Import links in OPML format.' ), 185 190 'plugin-slug' => 'opml-importer', 186 191 'importer-id' => 'opml', … … 188 193 'rss' => array( 189 194 'name' => __( 'RSS' ), 190 'description' => __( 'I nstall the RSS importer to import posts from an RSS feed.' ),195 'description' => __( 'Import posts from an RSS feed.' ), 191 196 'plugin-slug' => 'rss-importer', 192 197 'importer-id' => 'rss', … … 194 199 'tumblr' => array( 195 200 'name' => __( 'Tumblr' ), 196 'description' => __( 'I nstall the Tumblr importer to import posts & media from Tumblr using their API.' ),201 'description' => __( 'Import posts & media from Tumblr using their API.' ), 197 202 'plugin-slug' => 'tumblr-importer', 198 203 'importer-id' => 'tumblr', … … 200 205 'wordpress' => array( 201 206 'name' => 'WordPress', 202 'description' => __( 'I nstall the WordPress importer to import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.' ),207 'description' => __( 'Import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.' ), 203 208 'plugin-slug' => 'wordpress-importer', 204 209 'importer-id' => 'wordpress',
Note: See TracChangeset
for help on using the changeset viewer.