Changeset 7378 for trunk/src/includes/core/theme-compat.php
- Timestamp:
- 11/22/2025 06:05:25 AM (5 months ago)
- File:
-
- 1 edited
-
trunk/src/includes/core/theme-compat.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/theme-compat.php
r7376 r7378 47 47 * @var array 48 48 */ 49 private $_data = array(); 49 private $_data = array(); // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore 50 50 51 51 /** … … 447 447 } 448 448 449 // phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited 450 449 451 // Set the $post global 450 452 $post = new WP_Post( (object) $dummy ); … … 466 468 $wp_query->is_singular = $wp_query->is_single; 467 469 470 // phpcs:enable 471 468 472 // Clean up the dummy post 469 473 unset( $dummy ); … … 518 522 519 523 // Reset post 520 bbp_theme_compat_reset_post( array( 521 'ID' => 0, 522 'post_author' => 0, 523 'post_date' => bbp_get_empty_datetime(), 524 'post_content' => bbp_buffer_template_part( 'content', 'single-user', false ), 525 'post_type' => '', 526 'post_title' => bbp_get_displayed_user_field( 'display_name' ), 527 'post_status' => bbp_get_public_status_id(), 528 'is_archive' => false, 529 'comment_status' => 'closed' 530 ) ); 524 bbp_theme_compat_reset_post( 525 array( 526 'ID' => 0, 527 'post_author' => 0, 528 'post_date' => bbp_get_empty_datetime(), 529 'post_content' => bbp_buffer_template_part( 'content', 'single-user', false ), 530 'post_type' => '', 531 'post_title' => bbp_get_displayed_user_field( 'display_name' ), 532 'post_status' => bbp_get_public_status_id(), 533 'is_archive' => false, 534 'comment_status' => 'closed' 535 ) 536 ); 531 537 532 538 /** Forums ************************************************************/ … … 573 579 574 580 // Reset post 575 bbp_theme_compat_reset_post( array( 576 'ID' => ! empty( $page->ID ) ? $page->ID : 0, 577 'post_title' => $new_title, 578 'post_author' => 0, 579 'post_date' => bbp_get_empty_datetime(), 580 'post_content' => $new_content, 581 'post_type' => bbp_get_forum_post_type(), 582 'post_status' => bbp_get_public_status_id(), 583 'is_archive' => true, 584 'comment_status' => 'closed' 585 ) ); 581 bbp_theme_compat_reset_post( 582 array( 583 'ID' => ! empty( $page->ID ) ? $page->ID : 0, 584 'post_title' => $new_title, 585 'post_author' => 0, 586 'post_date' => bbp_get_empty_datetime(), 587 'post_content' => $new_content, 588 'post_type' => bbp_get_forum_post_type(), 589 'post_status' => bbp_get_public_status_id(), 590 'is_archive' => true, 591 'comment_status' => 'closed' 592 ) 593 ); 586 594 587 595 // Single Forum … … 589 597 590 598 // Reset post 591 bbp_theme_compat_reset_post( array( 592 'ID' => bbp_get_forum_id(), 593 'post_title' => bbp_get_forum_title(), 594 'post_author' => bbp_get_forum_author_id(), 595 'post_date' => bbp_get_empty_datetime(), 596 'post_content' => $bbp_shortcodes->display_forum_form(), 597 'post_type' => bbp_get_forum_post_type(), 598 'post_status' => bbp_get_forum_visibility(), 599 'is_single' => true, 600 'comment_status' => 'closed' 601 ) ); 599 bbp_theme_compat_reset_post( 600 array( 601 'ID' => bbp_get_forum_id(), 602 'post_title' => bbp_get_forum_title(), 603 'post_author' => bbp_get_forum_author_id(), 604 'post_date' => bbp_get_empty_datetime(), 605 'post_content' => $bbp_shortcodes->display_forum_form(), 606 'post_type' => bbp_get_forum_post_type(), 607 'post_status' => bbp_get_forum_visibility(), 608 'is_single' => true, 609 'comment_status' => 'closed' 610 ) 611 ); 602 612 603 613 // Lock the forum from other edits … … 607 617 608 618 // Reset post 609 bbp_theme_compat_reset_post( array( 610 'ID' => bbp_get_forum_id(), 611 'post_title' => bbp_get_forum_title(), 612 'post_author' => bbp_get_forum_author_id(), 613 'post_date' => bbp_get_empty_datetime(), 614 'post_content' => $bbp_shortcodes->display_forum( array( 'id' => bbp_get_forum_id() ) ), 615 'post_type' => bbp_get_forum_post_type(), 616 'post_status' => bbp_get_forum_visibility(), 617 'is_single' => true, 618 'comment_status' => 'closed' 619 ) ); 619 bbp_theme_compat_reset_post( 620 array( 621 'ID' => bbp_get_forum_id(), 622 'post_title' => bbp_get_forum_title(), 623 'post_author' => bbp_get_forum_author_id(), 624 'post_date' => bbp_get_empty_datetime(), 625 'post_content' => $bbp_shortcodes->display_forum( array( 'id' => bbp_get_forum_id() ) ), 626 'post_type' => bbp_get_forum_post_type(), 627 'post_status' => bbp_get_forum_visibility(), 628 'is_single' => true, 629 'comment_status' => 'closed' 630 ) 631 ); 620 632 621 633 /** Topics ************************************************************/ … … 646 658 647 659 // Reset post 648 bbp_theme_compat_reset_post( array( 649 'ID' => ! empty( $page->ID ) ? $page->ID : 0, 650 'post_title' => $new_title, 651 'post_author' => 0, 652 'post_date' => bbp_get_empty_datetime(), 653 'post_content' => $new_content, 654 'post_type' => bbp_get_topic_post_type(), 655 'post_status' => bbp_get_public_status_id(), 656 'is_archive' => true, 657 'comment_status' => 'closed' 658 ) ); 660 bbp_theme_compat_reset_post( 661 array( 662 'ID' => ! empty( $page->ID ) ? $page->ID : 0, 663 'post_title' => $new_title, 664 'post_author' => 0, 665 'post_date' => bbp_get_empty_datetime(), 666 'post_content' => $new_content, 667 'post_type' => bbp_get_topic_post_type(), 668 'post_status' => bbp_get_public_status_id(), 669 'is_archive' => true, 670 'comment_status' => 'closed' 671 ) 672 ); 659 673 660 674 // Single Topic … … 682 696 683 697 // Reset post 684 bbp_theme_compat_reset_post( array( 685 'ID' => bbp_get_topic_id(), 686 'post_title' => bbp_get_topic_title(), 687 'post_author' => bbp_get_topic_author_id(), 688 'post_date' => bbp_get_empty_datetime(), 689 'post_content' => $new_content, 690 'post_type' => bbp_get_topic_post_type(), 691 'post_status' => bbp_get_topic_status(), 692 'is_single' => true, 693 'comment_status' => 'closed' 694 ) ); 698 bbp_theme_compat_reset_post( 699 array( 700 'ID' => bbp_get_topic_id(), 701 'post_title' => bbp_get_topic_title(), 702 'post_author' => bbp_get_topic_author_id(), 703 'post_date' => bbp_get_empty_datetime(), 704 'post_content' => $new_content, 705 'post_type' => bbp_get_topic_post_type(), 706 'post_status' => bbp_get_topic_status(), 707 'is_single' => true, 708 'comment_status' => 'closed' 709 ) 710 ); 695 711 696 712 /** Replies ***********************************************************/ … … 700 716 701 717 // Reset post 702 bbp_theme_compat_reset_post( array( 703 'ID' => 0, 704 'post_title' => esc_html__( 'Replies', 'bbpress' ), 705 'post_author' => 0, 706 'post_date' => bbp_get_empty_datetime(), 707 'post_content' => '', 708 'post_type' => bbp_get_reply_post_type(), 709 'post_status' => bbp_get_public_status_id(), 710 'is_archive' => true, 711 'comment_status' => 'closed' 712 ) ); 718 bbp_theme_compat_reset_post( 719 array( 720 'ID' => 0, 721 'post_title' => esc_html__( 'Replies', 'bbpress' ), 722 'post_author' => 0, 723 'post_date' => bbp_get_empty_datetime(), 724 'post_content' => '', 725 'post_type' => bbp_get_reply_post_type(), 726 'post_status' => bbp_get_public_status_id(), 727 'is_archive' => true, 728 'comment_status' => 'closed' 729 ) 730 ); 713 731 714 732 // Single Reply … … 732 750 733 751 // Reset post 734 bbp_theme_compat_reset_post( array( 735 'ID' => bbp_get_reply_id(), 736 'post_title' => bbp_get_reply_title(), 737 'post_author' => bbp_get_reply_author_id(), 738 'post_date' => bbp_get_empty_datetime(), 739 'post_content' => $new_content, 740 'post_type' => bbp_get_reply_post_type(), 741 'post_status' => bbp_get_reply_status(), 742 'is_single' => true, 743 'comment_status' => 'closed' 744 ) ); 752 bbp_theme_compat_reset_post( 753 array( 754 'ID' => bbp_get_reply_id(), 755 'post_title' => bbp_get_reply_title(), 756 'post_author' => bbp_get_reply_author_id(), 757 'post_date' => bbp_get_empty_datetime(), 758 'post_content' => $new_content, 759 'post_type' => bbp_get_reply_post_type(), 760 'post_status' => bbp_get_reply_status(), 761 'is_single' => true, 762 'comment_status' => 'closed' 763 ) 764 ); 745 765 746 766 /** Views *************************************************************/ … … 749 769 750 770 // Reset post 751 bbp_theme_compat_reset_post( array( 752 'ID' => 0, 753 'post_title' => bbp_get_view_title(), 754 'post_author' => 0, 755 'post_date' => bbp_get_empty_datetime(), 756 'post_content' => $bbp_shortcodes->display_view( array( 'id' => get_query_var( bbp_get_view_rewrite_id() ) ) ), 757 'post_type' => '', 758 'post_status' => bbp_get_public_status_id(), 759 'is_archive' => true, 760 'comment_status' => 'closed' 761 ) ); 771 bbp_theme_compat_reset_post( 772 array( 773 'ID' => 0, 774 'post_title' => bbp_get_view_title(), 775 'post_author' => 0, 776 'post_date' => bbp_get_empty_datetime(), 777 'post_content' => $bbp_shortcodes->display_view( array( 'id' => get_query_var( bbp_get_view_rewrite_id() ) ) ), 778 'post_type' => '', 779 'post_status' => bbp_get_public_status_id(), 780 'is_archive' => true, 781 'comment_status' => 'closed' 782 ) 783 ); 762 784 763 785 /** Search ************************************************************/ … … 766 788 767 789 // Reset post 768 bbp_theme_compat_reset_post( array( 769 'ID' => 0, 770 'post_title' => bbp_get_search_title(), 771 'post_author' => 0, 772 'post_date' => bbp_get_empty_datetime(), 773 'post_content' => $bbp_shortcodes->display_search( array( 'search' => get_query_var( bbp_get_search_rewrite_id() ) ) ), 774 'post_type' => '', 775 'post_status' => bbp_get_public_status_id(), 776 'is_archive' => true, 777 'comment_status' => 'closed' 778 ) ); 790 bbp_theme_compat_reset_post( 791 array( 792 'ID' => 0, 793 'post_title' => bbp_get_search_title(), 794 'post_author' => 0, 795 'post_date' => bbp_get_empty_datetime(), 796 'post_content' => $bbp_shortcodes->display_search( array( 'search' => get_query_var( bbp_get_search_rewrite_id() ) ) ), 797 'post_type' => '', 798 'post_status' => bbp_get_public_status_id(), 799 'is_archive' => true, 800 'comment_status' => 'closed' 801 ) 802 ); 779 803 780 804 /** Topic Tags ********************************************************/ … … 796 820 797 821 // Reset the post with our new title 798 bbp_theme_compat_reset_post( array( 799 'ID' => 0, 800 'post_author' => 0, 801 'post_date' => bbp_get_empty_datetime(), 802 'post_content' => $new_content, 803 'post_type' => '', 804 /* translators: %s: Topic tag name */ 805 'post_title' => sprintf( esc_html__( 'Topic Tag: %s', 'bbpress' ), bbp_get_topic_tag_name() ), 806 'post_status' => bbp_get_public_status_id(), 807 'is_tax' => true, 808 'is_archive' => true, 809 'comment_status' => 'closed' 810 ) ); 822 bbp_theme_compat_reset_post( 823 array( 824 'ID' => 0, 825 'post_author' => 0, 826 'post_date' => bbp_get_empty_datetime(), 827 'post_content' => $new_content, 828 'post_type' => '', 829 /* translators: %s: Topic tag name */ 830 'post_title' => sprintf( esc_html__( 'Topic Tag: %s', 'bbpress' ), bbp_get_topic_tag_name() ), 831 'post_status' => bbp_get_public_status_id(), 832 'is_tax' => true, 833 'is_archive' => true, 834 'comment_status' => 'closed' 835 ) 836 ); 811 837 } 812 838 … … 1000 1026 global $wp_filter, $merged_filters; 1001 1027 1028 // phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited 1029 1002 1030 $bbp = bbpress(); 1003 1031 … … 1035 1063 } 1036 1064 1065 // phpcs:enable 1066 1037 1067 return true; 1038 1068 }
Note: See TracChangeset
for help on using the changeset viewer.