Changeset 45590 for trunk/src/wp-includes/revision.php
- Timestamp:
- 07/02/2019 11:41:16 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/revision.php
r44610 r45590 114 114 } 115 115 116 if ( ! $post = get_post( $post_id ) ) { 116 $post = get_post( $post_id ); 117 if ( ! $post ) { 117 118 return; 118 119 } … … 133 134 // they are different, unless a plugin tells us to always save regardless. 134 135 // If no previous revisions, save one 135 if ( $revisions = wp_get_post_revisions( $post_id ) ) { 136 $revisions = wp_get_post_revisions( $post_id ); 137 if ( $revisions ) { 136 138 // grab the last revision, but not an autosave 137 139 foreach ( $revisions as $revision ) { … … 255 257 */ 256 258 function wp_is_post_revision( $post ) { 257 if ( ! $post = wp_get_post_revision( $post ) ) { 259 $post = wp_get_post_revision( $post ); 260 if ( ! $post ) { 258 261 return false; 259 262 } … … 271 274 */ 272 275 function wp_is_post_autosave( $post ) { 273 if ( ! $post = wp_get_post_revision( $post ) ) { 276 $post = wp_get_post_revision( $post ); 277 if ( ! $post ) { 274 278 return false; 275 279 } … … 341 345 */ 342 346 function wp_get_post_revision( &$post, $output = OBJECT, $filter = 'raw' ) { 343 if ( ! $revision = get_post( $post, OBJECT, $filter ) ) { 347 $revision = get_post( $post, OBJECT, $filter ); 348 if ( ! $revision ) { 344 349 return $revision; 345 350 } … … 373 378 */ 374 379 function wp_restore_post_revision( $revision_id, $fields = null ) { 375 if ( ! $revision = wp_get_post_revision( $revision_id, ARRAY_A ) ) { 380 $revision = wp_get_post_revision( $revision_id, ARRAY_A ); 381 if ( ! $revision ) { 376 382 return $revision; 377 383 } … … 426 432 */ 427 433 function wp_delete_post_revision( $revision_id ) { 428 if ( ! $revision = wp_get_post_revision( $revision_id ) ) { 434 $revision = wp_get_post_revision( $revision_id ); 435 if ( ! $revision ) { 429 436 return $revision; 430 437 } … … 483 490 ); 484 491 485 if ( ! $revisions = get_children( $args ) ) { 492 $revisions = get_children( $args ); 493 if ( ! $revisions ) { 486 494 return array(); 487 495 } … … 602 610 */ 603 611 function _wp_preview_terms_filter( $terms, $post_id, $taxonomy ) { 604 if ( ! $post = get_post() ) { 612 $post = get_post(); 613 if ( ! $post ) { 605 614 return $terms; 606 615 } … … 612 621 if ( 'standard' == $_REQUEST['post_format'] ) { 613 622 $terms = array(); 614 } elseif ( $term = get_term_by( 'slug', 'post-format-' . sanitize_key( $_REQUEST['post_format'] ), 'post_format' ) ) { 615 $terms = array( $term ); // Can only have one post format 623 } else { 624 $term = get_term_by( 'slug', 'post-format-' . sanitize_key( $_REQUEST['post_format'] ), 'post_format' ); 625 if ( $term ) { 626 $terms = array( $term ); // Can only have one post format 627 } 616 628 } 617 629 … … 631 643 */ 632 644 function _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) { 633 if ( ! $post = get_post() ) { 645 $post = get_post(); 646 if ( ! $post ) { 634 647 return $value; 635 648 }
Note: See TracChangeset
for help on using the changeset viewer.