Changeset 7069
- Timestamp:
- 02/07/2020 05:48:35 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/template.php
r7066 r7069 135 135 */ 136 136 function bbp_is_forum_archive() { 137 global $wp_query;138 137 139 138 // Default to false 140 139 $retval = false; 140 141 // Get the main query global 142 $wp_query = bbp_get_wp_query(); 141 143 142 144 // In forum archive … … 183 185 */ 184 186 function bbp_is_forum_edit() { 185 global $wp_query, $pagenow; 186 187 // Assume false 188 $retval = false; 187 global $pagenow; 188 189 // Assume false 190 $retval = false; 191 192 // Get the main query global 193 $wp_query = bbp_get_wp_query(); 189 194 190 195 // Check query … … 278 283 */ 279 284 function bbp_is_topic_edit() { 280 global $wp_query, $pagenow; 281 282 // Assume false 283 $retval = false; 285 global $pagenow; 286 287 // Assume false 288 $retval = false; 289 290 // Get the main query global 291 $wp_query = bbp_get_wp_query(); 284 292 285 293 // Check query … … 377 385 */ 378 386 function bbp_is_topic_tag_edit() { 379 global $ wp_query, $pagenow, $taxnow;387 global $pagenow, $taxnow; 380 388 381 389 // Bail if topic-tags are off … … 386 394 // Assume false 387 395 $retval = false; 396 397 // Get the main query global 398 $wp_query = bbp_get_wp_query(); 388 399 389 400 // Check query … … 457 468 */ 458 469 function bbp_is_reply_edit() { 459 global $wp_query, $pagenow; 460 461 // Assume false 462 $retval = false; 470 global $pagenow; 471 472 // Assume false 473 $retval = false; 474 475 // Get the main query global 476 $wp_query = bbp_get_wp_query(); 463 477 464 478 // Check query … … 528 542 */ 529 543 function bbp_is_favorites() { 530 global $wp_query; 531 532 // Assume false 533 $retval = false; 544 545 // Assume false 546 $retval = false; 547 548 // Get the main query global 549 $wp_query = bbp_get_wp_query(); 534 550 535 551 // Check query … … 550 566 */ 551 567 function bbp_is_subscriptions() { 552 global $wp_query; 553 554 // Assume false 555 $retval = false; 568 569 // Assume false 570 $retval = false; 571 572 // Get the main query global 573 $wp_query = bbp_get_wp_query(); 556 574 557 575 // Check query … … 573 591 */ 574 592 function bbp_is_topics_created() { 575 global $wp_query; 576 577 // Assume false 578 $retval = false; 593 594 // Assume false 595 $retval = false; 596 597 // Get the main query global 598 $wp_query = bbp_get_wp_query(); 579 599 580 600 // Check query … … 596 616 */ 597 617 function bbp_is_replies_created() { 598 global $wp_query; 599 600 // Assume false 601 $retval = false; 618 619 // Assume false 620 $retval = false; 621 622 // Get the main query global 623 $wp_query = bbp_get_wp_query(); 602 624 603 625 // Check query … … 618 640 */ 619 641 function bbp_is_user_home() { 620 global $wp_query; 621 622 // Assume false 623 $retval = false; 642 643 // Assume false 644 $retval = false; 645 646 // Get the main query global 647 $wp_query = bbp_get_wp_query(); 624 648 625 649 // Check query … … 660 684 */ 661 685 function bbp_is_single_user() { 662 global $wp_query; 663 664 // Assume false 665 $retval = false; 686 687 // Assume false 688 $retval = false; 689 690 // Get the main query global 691 $wp_query = bbp_get_wp_query(); 666 692 667 693 // Check query … … 682 708 */ 683 709 function bbp_is_single_user_edit() { 684 global $wp_query; 685 686 // Assume false 687 $retval = false; 710 711 // Assume false 712 $retval = false; 713 714 // Get the main query global 715 $wp_query = bbp_get_wp_query(); 688 716 689 717 // Check query … … 704 732 */ 705 733 function bbp_is_single_user_profile() { 706 global $wp_query; 707 708 // Assume false 709 $retval = false; 734 735 // Assume false 736 $retval = false; 737 738 // Get the main query global 739 $wp_query = bbp_get_wp_query(); 710 740 711 741 // Check query … … 726 756 */ 727 757 function bbp_is_single_user_topics() { 728 global $wp_query; 729 730 // Assume false 731 $retval = false; 758 759 // Assume false 760 $retval = false; 761 762 // Get the main query global 763 $wp_query = bbp_get_wp_query(); 732 764 733 765 // Check query … … 748 780 */ 749 781 function bbp_is_single_user_replies() { 750 global $wp_query; 751 752 // Assume false 753 $retval = false; 782 783 // Assume false 784 $retval = false; 785 786 // Get the main query global 787 $wp_query = bbp_get_wp_query(); 754 788 755 789 // Check query … … 770 804 */ 771 805 function bbp_is_single_user_engagements() { 772 global $wp_query; 773 774 // Assume false 775 $retval = false; 806 807 // Assume false 808 $retval = false; 809 810 // Get the main query global 811 $wp_query = bbp_get_wp_query(); 776 812 777 813 // Check query … … 793 829 */ 794 830 function bbp_is_single_view() { 795 global $wp_query; 796 797 // Assume false 798 $retval = false; 831 832 // Assume false 833 $retval = false; 834 835 // Get the main query global 836 $wp_query = bbp_get_wp_query(); 799 837 800 838 // Check query … … 821 859 */ 822 860 function bbp_is_search() { 823 global $wp_query;824 861 825 862 // Bail if search is disabled … … 831 868 $retval = false; 832 869 870 // Get the main query global 871 $wp_query = bbp_get_wp_query(); 872 833 873 // Check query 834 874 if ( ! empty( $wp_query->bbp_is_search ) && ( true === $wp_query->bbp_is_search ) ) { … … 859 899 */ 860 900 function bbp_is_search_results() { 861 global $wp_query;862 901 863 902 // Bail if search is disabled … … 869 908 $retval = false; 870 909 910 // Get the main query global 911 $wp_query = bbp_get_wp_query(); 912 871 913 // Check query 872 914 if ( ! empty( $wp_query->bbp_search_terms ) ) { … … 896 938 */ 897 939 function bbp_is_edit() { 898 global $wp_query; 899 900 // Assume false 901 $retval = false; 940 941 // Assume false 942 $retval = false; 943 944 // Get the main query global 945 $wp_query = bbp_get_wp_query(); 902 946 903 947 // Check query
Note: See TracChangeset
for help on using the changeset viewer.