Ticket #24265: 24265.diff
| File 24265.diff, 5.5 KB (added by , 13 years ago) |
|---|
-
wp-includes/revision.php
13 13 * to be inserted into the posts table as a post revision. Otherwise, returns 14 14 * an array whose keys are the post fields to be saved for post revisions. 15 15 * 16 * @package WordPress17 * @subpackage Post_Revisions18 16 * @since 2.6.0 19 17 * @access private 18 * 20 19 * @uses apply_filters() Calls '_wp_post_revision_fields' on 'title', 'content' and 'excerpt' fields. 21 20 * 22 21 * @param array $post Optional a post array to be processed for insertion as a post revision. … … 64 63 * 65 64 * @since 3.6 66 65 * @access private 66 * 67 67 * @return array An array of meta keys that should be revisioned. 68 68 */ 69 69 function _wp_post_revision_meta_keys() { … … 85 85 * Typically used immediately after post updates. 86 86 * Adds a copy of the current post as a revision, so latest revision always matches current post 87 87 * 88 * @package WordPress89 * @subpackage Post_Revisions90 88 * @since 2.6.0 91 89 * 92 90 * @uses _wp_put_post_revision() … … 184 182 * specified post. If the optional $user_id is passed, returns the autosave for that user 185 183 * otherwise returns the latest autosave. 186 184 * 187 * @package WordPress188 * @subpackage Post_Revisions189 185 * @since 2.6.0 186 * 190 187 * @uses wp_get_post_revisions() 191 188 * 192 189 * @param int $post_id The post ID. … … 212 209 /** 213 210 * Determines if the specified post is a revision. 214 211 * 215 * @package WordPress216 * @subpackage Post_Revisions217 212 * @since 2.6.0 218 213 * 219 214 * @param int|object $post Post ID or post object. … … 229 224 /** 230 225 * Determines if the specified post is an autosave. 231 226 * 232 * @package WordPress233 * @subpackage Post_Revisions234 227 * @since 2.6.0 235 228 * 236 229 * @param int|object $post Post ID or post object. … … 249 242 /** 250 243 * Inserts post data into the posts table as a post revision. 251 244 * 252 * @package WordPress253 * @subpackage Post_Revisions254 245 * @since 2.6.0 246 * @access private 255 247 * 256 248 * @uses wp_insert_post() 257 249 * … … 303 295 /** 304 296 * Gets a post revision. 305 297 * 306 * @package WordPress307 * @subpackage Post_Revisions308 298 * @since 2.6.0 309 299 * 310 300 * @uses get_post() 311 301 * 312 * @param int|object $post Post ID or post object302 * @param int|object $post The post ID or object. 313 303 * @param string $output Optional. OBJECT, ARRAY_A, or ARRAY_N. 314 * @param string $filter Optional sanitation filter. @see sanitize_post() 315 * @return mixed Null if error or post object if success 304 * @param string $filter Optional sanitation filter. @see sanitize_post(). 305 * @return mixed Null if error or post object if success. 316 306 */ 317 307 function wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') { 318 308 $null = null; … … 339 329 * 340 330 * Can restore a past revision using all fields of the post revision, or only selected fields. 341 331 * 342 * @package WordPress343 * @subpackage Post_Revisions344 332 * @since 2.6.0 345 333 * 346 334 * @uses wp_get_post_revision() … … 405 393 * 406 394 * Deletes the row from the posts table corresponding to the specified revision. 407 395 * 408 * @package WordPress409 * @subpackage Post_Revisions410 396 * @since 2.6.0 411 397 * 412 398 * @uses wp_get_post_revision() … … 432 418 /** 433 419 * Returns all revisions of specified post. 434 420 * 435 * @package WordPress436 * @subpackage Post_Revisions437 421 * @since 2.6.0 438 422 * 439 423 * @uses get_children() 440 424 * 441 425 * @param int|object $post_id Post ID or post object 442 * @return array empty if no revisions426 * @return array An array of revisions, or an empty array if none. 443 427 */ 444 428 function wp_get_post_revisions( $post_id = 0, $args = null ) { 445 429 $post = get_post( $post_id ); … … 463 447 * 464 448 * @uses wp_revisions_to_keep() 465 449 * 466 * @param object $post 467 * @return bool 450 * @param object $post The post object. 451 * @return bool True if number of revisions to keep isn't zero, false otherwise. 468 452 */ 469 453 function wp_revisions_enabled( $post ) { 470 454 return wp_revisions_to_keep( $post ) != 0; … … 479 463 * @uses post_type_supports() 480 464 * @uses apply_filters() Calls 'wp_revisions_to_keep' hook on the number of revisions. 481 465 * 482 * @param object $post 483 * @return int 466 * @param object $post The post object. 467 * @return int The number of revisions to keep. 484 468 */ 485 469 function wp_revisions_to_keep( $post ) { 486 470 $num = WP_POST_REVISIONS; … … 496 480 return (int) apply_filters( 'wp_revisions_to_keep', $num, $post ); 497 481 } 498 482 483 /** 484 * Sets up the post object for preview based on the post autosave. 485 * 486 * @since 2.7.0 487 * @access private 488 */ 499 489 function _set_preview($post) { 500 490 501 491 if ( ! is_object($post) ) … … 518 508 return $post; 519 509 } 520 510 511 /** 512 * Filters the latest content for preview from the post autosave. 513 * 514 * @since 2.7.0 515 * @access private 516 */ 521 517 function _show_post_preview() { 522 518 523 519 if ( isset($_GET['preview_id']) && isset($_GET['preview_nonce']) ) { … … 573 569 return $terms; 574 570 } 575 571 572 /** 573 * Gets the post revision version. 574 * 575 * @since 3.6.0 576 * @access private 577 */ 576 578 function _wp_get_post_revision_version( $revision ) { 577 579 if ( is_object( $revision ) ) 578 580 $revision = get_object_vars( $revision ); … … 588 590 /** 589 591 * Upgrade the revisions author, add the current post as a revision and set the revisions version to 1 590 592 * 591 * @package WordPress592 * @subpackage Post_Revisions593 593 * @since 3.6.0 594 * @access private 594 595 * 595 596 * @uses wp_get_post_revisions() 596 597 * … … 683 684 * similar to wp_text_diff, but tracks and returns could of lines added and removed 684 685 * 685 686 * @since 3.6.0 687 * 686 688 * @see wp_parse_args() Used to change defaults to user defined settings. 687 689 * @uses Text_Diff 688 690 * @uses WP_Text_Diff_Renderer_Table