Changeset 12892 for trunk/src/bp-members/bp-members-template.php
- Timestamp:
- 04/18/2021 10:18:06 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-template.php
r12799 r12892 2801 2801 */ 2802 2802 function bp_get_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) { 2803 2804 2803 // Must be displayed user. 2805 if ( ! bp_displayed_user_id() )2804 if ( ! bp_displayed_user_id() ) { 2806 2805 return; 2806 } 2807 2807 2808 2808 $bp = buddypress(); 2809 2809 2810 if ( 'xprofile' === $component ) { 2811 $component = 'profile'; 2812 } 2813 2810 2814 // Append $action to $url if there is no $type. 2811 if ( ! empty( $action ) )2815 if ( ! empty( $action ) ) { 2812 2816 $url = bp_displayed_user_domain() . $bp->{$component}->slug . '/' . $action; 2813 else2817 } else { 2814 2818 $url = bp_displayed_user_domain() . $bp->{$component}->slug; 2819 } 2815 2820 2816 2821 // Add a slash at the end of our user url. … … 2818 2823 2819 2824 // Add possible query arg. 2820 if ( ! empty( $query_args ) && is_array( $query_args ) )2825 if ( ! empty( $query_args ) && is_array( $query_args ) ) { 2821 2826 $url = add_query_arg( $query_args, $url ); 2827 } 2822 2828 2823 2829 // To nonce, or not to nonce... 2824 if ( true === $nonce ) 2830 if ( true === $nonce ) { 2825 2831 $url = wp_nonce_url( $url ); 2826 elseif ( is_string( $nonce ) )2832 } elseif ( is_string( $nonce ) ) { 2827 2833 $url = wp_nonce_url( $url, $nonce ); 2834 } 2828 2835 2829 2836 // Return the url, if there is one. 2830 if ( ! empty( $url ) )2837 if ( ! empty( $url ) ) { 2831 2838 return $url; 2839 } 2832 2840 } 2833 2841
Note: See TracChangeset
for help on using the changeset viewer.