Changeset 6309
- Timestamp:
- 02/25/2017 12:12:52 AM (8 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/template.php
r6307 r6309 829 829 * 830 830 * @since 2.5.0 bbPress (r5156) 831 * @since 2.6.0 bbPress (r6308) Add 'redirect_to' support 831 832 * 832 833 * @uses bbp_get_forum_subscription_link() … … 842 843 * 843 844 * @since 2.5.0 bbPress (r5156) 845 * @since 2.6.0 bbPress (r6308) Add 'redirect_to' support 844 846 * 845 847 * @uses bbp_parse_args() … … 851 853 // Defaults 852 854 $retval = false; 853 $redirect_to = bbp_is_ favorites()854 ? bbp_get_ favorites_permalink()855 $redirect_to = bbp_is_subscriptions() 856 ? bbp_get_subscriptions_permalink() 855 857 : ''; 856 858 -
trunk/src/includes/topics/template.php
r6307 r6309 1905 1905 * 1906 1906 * @since 2.5.0 bbPress (r5156) 1907 * @since 2.6.0 bbPress (r6308) Add 'redirect_to' support 1907 1908 * 1908 1909 * @uses bbp_get_topic_subscription_link() … … 1918 1919 * 1919 1920 * @since 2.5.0 bbPress (r5156) 1920 * 1921 * @since 2.6.0 bbPress (r6308) Add 'redirect_to' support 1922 * 1923 * @uses bbp_is_subscriptions() 1924 * @uses bbp_get_subscriptions_permalink() 1921 1925 * @uses bbp_parse_args() 1922 1926 * @uses bbp_get_user_subscribe_link() … … 1954 1958 * 1955 1959 * @since 2.5.0 bbPress (r5156) 1960 * @since 2.6.0 bbPress (r6308) Add 'redirect_to' support 1956 1961 * 1957 1962 * @uses bbp_get_topic_favorite_link() … … 1967 1972 * 1968 1973 * @since 2.5.0 bbPress (r5156) 1969 * 1974 * @since 2.6.0 bbPress (r6308) Add 'redirect_to' support 1975 * 1976 * @uses bbp_is_favorites() 1977 * @uses bbp_get_favorites_permalink() 1970 1978 * @uses bbp_parse_args() 1971 1979 * @uses bbp_get_user_favorites_link() -
trunk/src/includes/users/template.php
r6308 r6309 798 798 * 799 799 * @since 2.0.0 bbPress (r2652) 800 * @since 2.6.0 bbPress (r6308) Add pagination if in the loop 800 801 * 801 802 * @param int $user_id Optional. User id … … 809 810 * 810 811 * @since 2.0.0 bbPress (r2652) 812 * @since 2.6.0 bbPress (r6308) Add pagination if in the loop 811 813 * 812 814 * @param int $user_id Optional. User id … … 842 844 843 845 // Add page 844 if ( true === $paged) {846 if ( ( true === $paged ) && ( $page > 1 ) ) { 845 847 $url = trailingslashit( $url ) . bbp_get_paged_slug() . '/' . $page; 846 848 } … … 858 860 859 861 // Add page 860 if ( true === $paged) {862 if ( ( true === $paged ) && ( $page > 1 ) ) { 861 863 $args['page'] = $page; 862 864 } … … 873 875 * 874 876 * @since 2.0.0 bbPress (r2652) 877 * @since 2.6.0 bbPress (r6308) Add 'redirect_to' support 875 878 * 876 879 * @param array $args See {@link bbp_get_user_favorites_link()} … … 889 892 * 890 893 * @since 2.0.0 bbPress (r2652) 894 * @since 2.6.0 bbPress (r6308) Add 'redirect_to' support 891 895 * 892 896 * @param array $args This function supports these arguments: … … 912 916 */ 913 917 function bbp_get_user_favorites_link( $args = array(), $user_id = 0, $wrap = true ) { 918 919 // Bail if favorites are inactive 914 920 if ( ! bbp_is_favorites_active() ) { 915 921 return false; … … 951 957 // Custom redirect 952 958 if ( ! empty( $r['redirect_to'] ) ) { 953 $query_args['redirect_to'] = esc_url( $r['redirect_to'] );959 $query_args['redirect_to'] = urlencode( $r['redirect_to'] ); 954 960 } 955 961 … … 983 989 * 984 990 * @since 2.0.0 bbPress (r2688) 991 * @since 2.6.0 bbPress (r6308) Add pagination if in the loop 985 992 * 986 993 * @param int $user_id Optional. User id … … 994 1001 * 995 1002 * @since 2.0.0 bbPress (r2688) 1003 * @since 2.6.0 bbPress (r6308) Add pagination if in the loop 996 1004 * 997 1005 * @param int $user_id Optional. User id … … 1017 1025 // Get user profile URL 1018 1026 $profile_url = bbp_get_user_profile_url( $user_id ); 1019 $page = (int) bbpress()->topic_query->paged; 1020 $paged = (bool) bbpress()->topic_query->in_the_loop; 1021 1027 $page = 0; 1028 $paged = false; 1029 1030 // Get pagination data 1031 if ( bbpress()->topic_query->in_the_loop ) { 1032 $page = (int) bbpress()->topic_query->paged; 1033 $paged = (bool) bbpress()->topic_query->in_the_loop; 1034 1035 } elseif ( bbpress()->forum_query->in_the_loop ) { 1036 $page = (int) bbpress()->forum_query->paged; 1037 $paged = (bool) bbpress()->forum_query->in_the_loop; 1038 } 1039 1022 1040 // Pretty permalinks 1023 1041 if ( bbp_use_pretty_urls() ) { … … 1027 1045 1028 1046 // Add page 1029 if ( true === $paged) {1047 if ( ( true === $paged ) && ( $page > 1 ) ) { 1030 1048 $url = trailingslashit( $url ) . bbp_get_paged_slug() . '/' . $page; 1031 1049 } … … 1043 1061 1044 1062 // Add page 1045 if ( true === $paged) {1063 if ( ( true === $paged ) && ( $page > 1 ) ) { 1046 1064 $args['page'] = $page; 1047 1065 } … … 1058 1076 * 1059 1077 * @since 2.0.0 bbPress (r2668) 1078 * @since 2.6.0 bbPress (r6308) Add 'redirect_to' support 1060 1079 * 1061 1080 * @param array $args See {@link bbp_get_user_subscribe_link()} … … 1071 1090 * 1072 1091 * @since 2.0.0 bbPress (r2668) 1092 * @since 2.6.0 bbPress (r6308) Add 'redirect_to' support 1073 1093 * 1074 1094 * @param array $args This function supports these arguments: … … 1098 1118 */ 1099 1119 function bbp_get_user_subscribe_link( $args = array(), $user_id = 0, $wrap = true ) { 1120 1121 // Bail if subscriptions are inactive 1100 1122 if ( ! bbp_is_subscriptions_active() ) { 1101 1123 return; … … 1178 1200 // Custom redirect 1179 1201 if ( ! empty( $r['redirect_to'] ) ) { 1180 $query_args['redirect_to'] = esc_url( $r['redirect_to'] );1202 $query_args['redirect_to'] = urlencode( $r['redirect_to'] ); 1181 1203 } 1182 1204
Note: See TracChangeset
for help on using the changeset viewer.