Changeset 13436 for trunk/src/bp-members/bp-members-template.php
- Timestamp:
- 03/15/2023 08:16:46 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-template.php
r13433 r13436 141 141 */ 142 142 function bp_get_members_directory_permalink() { 143 $url = bp_rewrites_get_url( 144 array( 145 'component_id' => 'members', 146 ) 147 ); 143 148 144 149 /** … … 147 152 * @since 1.5.0 148 153 * 149 * @param string $ valueMembers directory permalink.150 */ 151 return apply_filters( 'bp_get_members_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ));154 * @param string $url Members directory permalink. 155 */ 156 return apply_filters( 'bp_get_members_directory_permalink', $url ); 152 157 } 153 158 … … 186 191 } 187 192 193 $url = bp_rewrites_get_url( 194 array( 195 'component_id' => 'members', 196 'directory_type' => $type->directory_slug, 197 ) 198 ); 199 188 200 /** 189 201 * Filters the member type directory permalink. … … 191 203 * @since 2.5.0 192 204 * 193 * @param string $ valueMember type directory permalink.205 * @param string $url Member type directory permalink. 194 206 * @param object $type Member type object. 195 207 * @param string $member_type Member type name, as passed to the function. 196 208 */ 197 return apply_filters( 'bp_get_member_type_directory_permalink', trailingslashit( bp_get_members_directory_permalink() . bp_get_members_member_type_base() . '/' . $type->directory_slug ), $type, $member_type );209 return apply_filters( 'bp_get_member_type_directory_permalink', $url, $type, $member_type ); 198 210 } 199 211 … … 1458 1470 1459 1471 // Always add a log out list item to the end of the navigation. 1460 $logout_link = '<li><a id="wp-logout" href="' . wp_logout_url( bp_get_root_ domain() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';1472 $logout_link = '<li><a id="wp-logout" href="' . wp_logout_url( bp_get_root_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>'; 1461 1473 1462 1474 echo apply_filters( 'bp_logout_nav_link', $logout_link ); … … 1852 1864 1853 1865 /** 1854 * Output the link for the logged-in user's profile.1855 *1856 * @since 1.2.41857 */1858 function bp_loggedin_user_link() {1859 echo esc_url( bp_get_loggedin_user_link() );1860 }1861 /**1862 * Get the link for the logged-in user's profile.1863 *1864 * @since 1.0.01865 *1866 * @return string1867 */1868 function bp_get_loggedin_user_link() {1869 1870 /**1871 * Filters the link for the logged-in user's profile.1872 *1873 * @since 1.2.41874 *1875 * @param string $value Link for the logged-in user's profile.1876 */1877 return apply_filters( 'bp_get_loggedin_user_link', bp_loggedin_user_domain() );1878 }1879 1880 /**1881 * Output the link for the displayed user's profile.1882 *1883 * @since 1.2.41884 */1885 function bp_displayed_user_link() {1886 echo esc_url( bp_get_displayed_user_link() );1887 }1888 /**1889 * Get the link for the displayed user's profile.1890 *1891 * @since 1.0.01892 *1893 * @return string1894 */1895 function bp_get_displayed_user_link() {1896 1897 /**1898 * Filters the link for the displayed user's profile.1899 *1900 * @since 1.2.41901 *1902 * @param string $value Link for the displayed user's profile.1903 */1904 return apply_filters( 'bp_get_displayed_user_link', bp_displayed_user_domain() );1905 }1906 1907 /**1908 * Alias of {@link bp_displayed_user_domain()}.1909 *1910 * @deprecated1911 */1912 function bp_user_link() {1913 bp_displayed_user_domain();1914 }1915 1916 /**1917 1866 * Alias of {@link bp_displayed_user_id()}. 1918 1867 * … … 1924 1873 1925 1874 /** 1875 * Output the link for the displayed user's profile. 1876 * 1877 * @since 1.2.4 1878 */ 1879 function bp_displayed_user_link() { 1880 echo esc_url( bp_displayed_user_url() ); 1881 } 1882 1883 /** 1884 * Builds the logged-in user's profile URL. 1885 * 1886 * @since 12.0.0 1887 * 1888 * @param array $path_chunks { 1889 * An array of arguments. Optional. 1890 * 1891 * @type string $single_item_component The component slug the action is relative to. 1892 * @type string $single_item_action The slug of the action to perform. 1893 * @type array $single_item_action_variables An array of additional informations about the action to perform. 1894 * } 1895 * @return string The logged-in user's profile URL. 1896 */ 1897 function bp_displayed_user_url( $path_chunks = array() ) { 1898 $bp = buddypress(); 1899 $url = ''; 1900 1901 if ( isset( $bp->displayed_user->domain ) ) { 1902 $url = $bp->displayed_user->domain; 1903 } 1904 1905 if ( $path_chunks ) { 1906 $url = bp_members_get_user_url( bp_displayed_user_id(), $path_chunks ); 1907 } 1908 1909 /** 1910 * Filter here to edit the displayed user's profile URL. 1911 * 1912 * @since 12.0.0 1913 * 1914 * @param string $url The displayed user's profile URL. 1915 * @param array $path_chunks { 1916 * An array of arguments. Optional. 1917 * 1918 * @type string $single_item_component The component slug the action is relative to. 1919 * @type string $single_item_action The slug of the action to perform. 1920 * @type array $single_item_action_variables An array of additional informations about the action to perform. 1921 * } 1922 */ 1923 return apply_filters( 'bp_displayed_user_url', $url, $path_chunks ); 1924 } 1925 1926 /** 1926 1927 * Generate the link for the displayed user's profile. 1927 1928 * 1928 1929 * @since 1.0.0 1929 * 1930 * @since 12.0.0 This function is now an alias of `bp_displayed_user_url()`. 1931 * You should only use it to get the "home" URL of the displayed 1932 * user's profile page. If you need to build an URL to reach another 1933 * page, we strongly advise you to use `bp_displayed_user_url()`. 1934 * 1935 * @todo Deprecating this function would be safer. 1930 1936 * @return string 1931 1937 */ 1932 1938 function bp_displayed_user_domain() { 1933 $ bp = buddypress();1939 $url = bp_displayed_user_url(); 1934 1940 1935 1941 /** … … 1938 1944 * @since 1.0.0 1939 1945 * 1940 * @param string $value Generated link for the displayed user's profile. 1941 */ 1942 return apply_filters( 'bp_displayed_user_domain', isset( $bp->displayed_user->domain ) ? $bp->displayed_user->domain : '' ); 1946 * @param string $url Generated link for the displayed user's profile. 1947 */ 1948 return apply_filters( 'bp_displayed_user_domain',$url ); 1949 } 1950 1951 /** 1952 * Output the link for the logged-in user's profile. 1953 * 1954 * @since 1.2.4 1955 */ 1956 function bp_loggedin_user_link() { 1957 echo esc_url( bp_loggedin_user_url() ); 1958 } 1959 1960 /** 1961 * Builds the logged-in user's profile URL. 1962 * 1963 * @since 12.0.0 1964 * 1965 * @param array $path_chunks { 1966 * An array of arguments. Optional. 1967 * 1968 * @type string $single_item_component The component slug the action is relative to. 1969 * @type string $single_item_action The slug of the action to perform. 1970 * @type array $single_item_action_variables An array of additional informations about the action to perform. 1971 * } 1972 * @return string The logged-in user's profile URL. 1973 */ 1974 function bp_loggedin_user_url( $path_chunks = array() ) { 1975 $bp = buddypress(); 1976 $url = ''; 1977 1978 if ( isset( $bp->loggedin_user->domain ) ) { 1979 $url = $bp->loggedin_user->domain; 1980 } 1981 1982 if ( $path_chunks ) { 1983 $url = bp_members_get_user_url( bp_loggedin_user_id(), $path_chunks ); 1984 } 1985 1986 /** 1987 * Filter here to edit the logged-in user's profile URL. 1988 * 1989 * @since 12.0.0 1990 * 1991 * @param string $url The logged-in user's profile URL. 1992 * @param array $path_chunks { 1993 * An array of arguments. Optional. 1994 * 1995 * @type string $single_item_component The component slug the action is relative to. 1996 * @type string $single_item_action The slug of the action to perform. 1997 * @type array $single_item_action_variables An array of additional informations about the action to perform. 1998 * } 1999 */ 2000 return apply_filters( 'bp_loggedin_user_url', $url, $path_chunks ); 1943 2001 } 1944 2002 … … 1947 2005 * 1948 2006 * @since 1.0.0 1949 * 2007 * @since 12.0.0 This function is now an alias of `bp_loggedin_user_url()`. 2008 * You should only use it to get the "home" URL of the logged-in 2009 * user's profile page. If you need to build an URL to reach another 2010 * page, we strongly advise you to use `bp_loggedin_user_url()`. 2011 * 2012 * @todo Deprecating this function would be safer. 1950 2013 * @return string 1951 2014 */ 1952 2015 function bp_loggedin_user_domain() { 1953 $ bp = buddypress();2016 $url = bp_loggedin_user_url(); 1954 2017 1955 2018 /** … … 1958 2021 * @since 1.0.0 1959 2022 * 1960 * @param string $ valueGenerated link for the logged-in user's profile.1961 */ 1962 return apply_filters( 'bp_loggedin_user_domain', isset( $bp->loggedin_user->domain ) ? $bp->loggedin_user->domain : '');2023 * @param string $url Generated link for the logged-in user's profile. 2024 */ 2025 return apply_filters( 'bp_loggedin_user_domain', $url ); 1963 2026 } 1964 2027 … … 2347 2410 function bp_get_signup_page() { 2348 2411 if ( bp_has_custom_signup_page() ) { 2349 $page = trailingslashit( bp_get_root_domain() . '/' . bp_get_signup_slug() ); 2412 $page = bp_rewrites_get_url( 2413 array( 2414 'component_id' => 'members', 2415 'member_register' => 1, 2416 ) 2417 ); 2418 2350 2419 } else { 2351 $page = bp_get_root_domain() . '/wp-signup.php';2420 $page = trailingslashit( bp_get_root_url() ) . 'wp-signup.php'; 2352 2421 } 2353 2422 … … 2396 2465 function bp_get_activation_page() { 2397 2466 if ( bp_has_custom_activation_page() ) { 2398 $page = trailingslashit( bp_get_root_domain() . '/' . bp_get_activate_slug() ); 2467 $page = bp_rewrites_get_url( 2468 array( 2469 'component_id' => 'members', 2470 'member_activate' => 1, 2471 ) 2472 ); 2473 2399 2474 } else { 2400 $page = trailingslashit( bp_get_root_ domain() ) . 'wp-activate.php';2475 $page = trailingslashit( bp_get_root_url() ) . 'wp-activate.php'; 2401 2476 } 2402 2477 … … 3566 3641 if ( 0 === $user_id ) { 3567 3642 $user_id = bp_loggedin_user_id(); 3568 $domain = bp_loggedin_user_domain(); 3569 } else { 3570 $domain = bp_members_get_user_url( (int) $user_id ); 3571 } 3572 3573 $retval = trailingslashit( $domain . bp_get_members_invitations_slug() . '/list-invites' ); 3643 } 3644 3645 $retval = bp_members_get_user_url( 3646 (int) $user_id, 3647 array( 3648 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_invitations', bp_get_members_invitations_slug() ), 3649 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_invitations_list_invites', 'list-invites' ), 3650 ) 3651 ); 3574 3652 3575 3653 /** … … 3605 3683 if ( 0 === $user_id ) { 3606 3684 $user_id = bp_loggedin_user_id(); 3607 $domain = bp_loggedin_user_domain(); 3608 } else { 3609 $domain = bp_members_get_user_url( (int) $user_id ); 3610 } 3611 3612 $retval = trailingslashit( $domain . bp_get_members_invitations_slug() . '/send-invites' ); 3685 } 3686 3687 $retval = bp_members_get_user_url( 3688 (int) $user_id, 3689 array( 3690 'single_item_component' => bp_rewrites_get_slug( 'members', 'member_invitations', bp_get_members_invitations_slug() ), 3691 'single_item_action' => bp_rewrites_get_slug( 'members', 'member_invitations_send_invites', 'send-invites' ), 3692 ) 3693 ); 3613 3694 3614 3695 /**
Note: See TracChangeset
for help on using the changeset viewer.