Changeset 27102 for trunk/src/wp-includes/taxonomy.php
- Timestamp:
- 02/06/2014 01:58:01 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r27101 r27102 2949 2949 if ( !is_taxonomy_hierarchical($taxonomy) ) 2950 2950 return array(); 2951 $children = get_option("{$taxonomy}_children"); 2951 $children = false; 2952 if ( taxonomy_hierarchy_is_fresh( $taxonomy ) ) { 2953 $children = get_option("{$taxonomy}_children"); 2954 } 2952 2955 2953 2956 if ( is_array($children) ) … … 3522 3525 * Determine if a post's cache for the passed taxonomy 3523 3526 * is in sync. 3527 * 3524 3528 * @since 3.9.0 3525 3529 * … … 3537 3541 return true; 3538 3542 } 3543 3544 /** 3545 * Determine if a hierarchy's cache for the passed taxonomy 3546 * is in sync. 3547 * 3548 * @since 3.9.0 3549 * 3550 * @param int $id 3551 * @param string $taxonomy 3552 * @return boolean 3553 */ 3554 function taxonomy_hierarchy_is_fresh( $taxonomy ) { 3555 $last_changed = get_taxonomy_last_changed( $taxonomy ); 3556 $hierarchy_last_changed = wp_cache_get( 'hierarchy_last_changed', $taxonomy ); 3557 if ( ! $hierarchy_last_changed || $last_changed !== $hierarchy_last_changed ) { 3558 wp_cache_set( 'hierarchy_last_changed', $last_changed, $taxonomy ); 3559 return false; 3560 } 3561 return true; 3562 }
Note: See TracChangeset
for help on using the changeset viewer.