Changeset 27719 for trunk/src/wp-includes/option.php
- Timestamp:
- 03/25/2014 06:22:49 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/option.php
r27365 r27719 643 643 $result = add_option( $transient, $value, '', $autoload ); 644 644 } else { 645 if ( $expiration ) 646 update_option( $transient_timeout, time() + $expiration ); 647 $result = update_option( $transient, $value ); 645 // If expiration is requested, but the transient has no timeout option, 646 // delete, then re-create transient rather than update. 647 $update = true; 648 if ( $expiration ) { 649 if ( false === get_option( $transient_timeout ) ) { 650 delete_option( $transient ); 651 add_option( $transient_timeout, time() + $expiration, '', 'no' ); 652 $result = add_option( $transient, $value, '', 'no' ); 653 $update = false; 654 } else { 655 update_option( $transient_timeout, time() + $expiration ); 656 } 657 } 658 if ( $update ) { 659 $result = update_option( $transient, $value ); 660 } 648 661 } 649 662 }
Note: See TracChangeset
for help on using the changeset viewer.