Changeset 640
- Timestamp:
- 05/23/2014 06:04:40 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
r639 r640 254 254 * Prefers the 'wp_parser_imported_wp_version' option value set by more 255 255 * recent versions of the parser. Failing that, it checks the 256 * WP_CORE_LATEST_RELEASE constant (set on wp.org) though this is not 257 * guaranteed to be the latest parsed version. Failing that, it uses a 258 * hardcoded value, which isn't guaranteed either. 256 * WP_CORE_LATEST_RELEASE constant (set on WP.org) though this is not 257 * guaranteed to be the latest parsed version. Failing that, it uses 258 * the WP version of the site, unless it isn't a release version, in 259 * which case a hardcoded value is assumed. 259 260 * 260 261 * @return string 261 262 */ 262 263 function get_current_version() { 264 global $wp_version; 265 266 // Preference for the value saved as an option. 263 267 $current_version = get_option( 'wp_parser_imported_wp_version' ); 264 268 269 // Otherwise, assume the value stored in a constant (which is set on WP.org), if defined. 270 if ( empty( $current_version ) && defined( 'WP_CORE_LATEST_RELEASE' ) && WP_CORE_LATEST_RELEASE ) { 271 $current_version = WP_CORE_LATEST_RELEASE; 272 } 273 274 // Otherwise, use the version of the running WP instance. 265 275 if ( empty( $current_version ) ) { 266 $current_version = defined( 'WP_CORE_LATEST_RELEASE' ) ? WP_CORE_LATEST_RELEASE : '3.9.1'; 276 $current_version = $wp_version; 277 278 // However, if the running WP instance appears to not be a release 279 // version, assume a hardcoded version that is at least valid. 280 if ( false !== strpos( $current_version, '-' ) ) { 281 $current_version = '3.9.1'; 282 } 267 283 } 268 284
Note: See TracChangeset
for help on using the changeset viewer.