Changeset 7100
- Timestamp:
- 06/04/2020 10:01:45 PM (5 years ago)
- Location:
- branches/2.6/src/includes/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/src/includes/core/abstraction.php
r6889 r7100 476 476 : $filtered; 477 477 } 478 479 /** Date/Time *****************************************************************/ 480 481 /** 482 * Get an empty datetime value. 483 * 484 * @since 2.6.6 bbPress (r7094) 485 * 486 * @return string 487 */ 488 function bbp_get_empty_datetime() { 489 490 // Get the database version 491 $db_version = bbp_db()->db_version(); 492 493 // Default return value 494 $retval = '0000-00-00 00:00:00'; 495 496 // Filter & return 497 return (string) apply_filters( 'bbp_get_default_zero_date', $retval, $db_version ); 498 } -
branches/2.6/src/includes/core/theme-compat.php
r7073 r7100 365 365 // Switch defaults if post is set 366 366 if ( isset( $wp_query->post ) ) { 367 $dummy = bbp_parse_args( $args, array( 367 368 // Use primarily Post attributes 369 $defaults = array( 368 370 'ID' => $wp_query->post->ID, 369 371 'post_status' => $wp_query->post->post_status, … … 396 398 'is_archive' => false, 397 399 'is_tax' => false 398 ) , 'theme_compat_reset_post' );400 ); 399 401 } else { 400 $dummy = bbp_parse_args( $args, array( 402 403 // Get the default zero date value a single time 404 $zero_date = bbp_get_empty_datetime(); 405 406 // Use primarily empty attributes 407 $defaults = array( 401 408 'ID' => -9999, 402 409 'post_status' => bbp_get_public_status_id(), … … 404 411 'post_parent' => 0, 405 412 'post_type' => 'page', 406 'post_date' => 0,407 'post_date_gmt' => 0,408 'post_modified' => 0,409 'post_modified_gmt' => 0,413 'post_date' => $zero_date, 414 'post_date_gmt' => $zero_date, 415 'post_modified' => $zero_date, 416 'post_modified_gmt' => $zero_date, 410 417 'post_content' => '', 411 418 'post_title' => '', … … 429 436 'is_archive' => false, 430 437 'is_tax' => false 431 ), 'theme_compat_reset_post' ); 432 } 438 ); 439 } 440 441 // Parse & filter 442 $dummy = bbp_parse_args( $args, $defaults, 'theme_compat_reset_post' ); 433 443 434 444 // Bail if dummy post is empty … … 511 521 'ID' => 0, 512 522 'post_author' => 0, 513 'post_date' => 0,523 'post_date' => bbp_get_empty_datetime(), 514 524 'post_content' => bbp_buffer_template_part( 'content', 'single-user', false ), 515 525 'post_type' => '', … … 567 577 'post_title' => $new_title, 568 578 'post_author' => 0, 569 'post_date' => 0,579 'post_date' => bbp_get_empty_datetime(), 570 580 'post_content' => $new_content, 571 581 'post_type' => bbp_get_forum_post_type(), … … 583 593 'post_title' => bbp_get_forum_title(), 584 594 'post_author' => bbp_get_forum_author_id(), 585 'post_date' => 0,595 'post_date' => bbp_get_empty_datetime(), 586 596 'post_content' => $bbp_shortcodes->display_forum_form(), 587 597 'post_type' => bbp_get_forum_post_type(), … … 601 611 'post_title' => bbp_get_forum_title(), 602 612 'post_author' => bbp_get_forum_author_id(), 603 'post_date' => 0,613 'post_date' => bbp_get_empty_datetime(), 604 614 'post_content' => $bbp_shortcodes->display_forum( array( 'id' => bbp_get_forum_id() ) ), 605 615 'post_type' => bbp_get_forum_post_type(), … … 640 650 'post_title' => bbp_get_topic_archive_title(), 641 651 'post_author' => 0, 642 'post_date' => 0,652 'post_date' => bbp_get_empty_datetime(), 643 653 'post_content' => $new_content, 644 654 'post_type' => bbp_get_topic_post_type(), … … 676 686 'post_title' => bbp_get_topic_title(), 677 687 'post_author' => bbp_get_topic_author_id(), 678 'post_date' => 0,688 'post_date' => bbp_get_empty_datetime(), 679 689 'post_content' => $new_content, 680 690 'post_type' => bbp_get_topic_post_type(), … … 694 704 'post_title' => esc_html__( 'Replies', 'bbpress' ), 695 705 'post_author' => 0, 696 'post_date' => 0,706 'post_date' => bbp_get_empty_datetime(), 697 707 'post_content' => $bbp_shortcodes->display_reply_index(), 698 708 'post_type' => bbp_get_reply_post_type(), … … 726 736 'post_title' => bbp_get_reply_title(), 727 737 'post_author' => bbp_get_reply_author_id(), 728 'post_date' => 0,738 'post_date' => bbp_get_empty_datetime(), 729 739 'post_content' => $new_content, 730 740 'post_type' => bbp_get_reply_post_type(), … … 743 753 'post_title' => bbp_get_view_title(), 744 754 'post_author' => 0, 745 'post_date' => 0,755 'post_date' => bbp_get_empty_datetime(), 746 756 'post_content' => $bbp_shortcodes->display_view( array( 'id' => get_query_var( bbp_get_view_rewrite_id() ) ) ), 747 757 'post_type' => '', … … 760 770 'post_title' => bbp_get_search_title(), 761 771 'post_author' => 0, 762 'post_date' => 0,772 'post_date' => bbp_get_empty_datetime(), 763 773 'post_content' => $bbp_shortcodes->display_search( array( 'search' => get_query_var( bbp_get_search_rewrite_id() ) ) ), 764 774 'post_type' => '', … … 789 799 'ID' => 0, 790 800 'post_author' => 0, 791 'post_date' => 0,801 'post_date' => bbp_get_empty_datetime(), 792 802 'post_content' => $new_content, 793 803 'post_type' => '',
Note: See TracChangeset
for help on using the changeset viewer.