Changeset 13808
- Timestamp:
- 04/26/2024 05:44:26 AM (12 months ago)
- Location:
- trunk/src/bp-groups
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-admin.php
r13482 r13808 535 535 */ 536 536 function bp_groups_admin_screen_options( $value, $option, $new_value ) { 537 if ( 'toplevel_page_bp_groups_per_page' != $option && 'toplevel_page_bp_groups_network_per_page' != $option ) 537 if ( 'toplevel_page_bp_groups_per_page' != $option && 'toplevel_page_bp_groups_network_per_page' != $option ) { 538 538 return $value; 539 } 539 540 540 541 // Per page. 541 542 $new_value = (int) $new_value; 542 if ( $new_value < 1 || $new_value > 999 ) 543 if ( $new_value < 1 || $new_value > 999 ) { 543 544 return $value; 545 } 544 546 545 547 return $new_value; … … 576 578 function bp_groups_admin_edit() { 577 579 578 if ( ! bp_current_user_can( 'bp_moderate' ) ) 580 if ( ! bp_current_user_can( 'bp_moderate' ) ) { 579 581 die( '-1' ); 582 } 580 583 581 584 $messages = array(); 582 585 583 586 // If the user has just made a change to a group, build status messages. 584 if ( ! empty( $_REQUEST['no_admins'] ) || ! empty( $_REQUEST['error'] ) || ! empty( $_REQUEST['updated'] ) || ! empty( $_REQUEST['error_new'] ) || ! empty( $_REQUEST['success_new'] ) || ! empty( $_REQUEST['error_modified'] ) || ! empty( $_REQUEST['success_modified'] ) ) {587 if ( ! empty( $_REQUEST['no_admins'] ) || ! empty( $_REQUEST['error'] ) || ! empty( $_REQUEST['updated'] ) || ! empty( $_REQUEST['error_new'] ) || ! empty( $_REQUEST['success_new'] ) || ! empty( $_REQUEST['error_modified'] ) || ! empty( $_REQUEST['success_modified'] ) ) { 585 588 $no_admins = ! empty( $_REQUEST['no_admins'] ) ? 1 : 0; 586 589 $errors = ! empty( $_REQUEST['error'] ) ? $_REQUEST['error'] : ''; … … 653 656 654 657 <div class="wrap"> 655 <h1 class="wp-heading-inline"><?php _e( 'Edit Group', 'buddypress' ); ?></h1>658 <h1 class="wp-heading-inline"><?php esc_html_e( 'Edit Group', 'buddypress' ); ?></h1> 656 659 657 660 <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?> … … 662 665 663 666 <?php // If the user has just made a change to an group, display the status messages. ?> 664 <?php if ( ! empty( $messages ) ) : ?>665 <div id="moderated" class="<?php echo ( $is_error ) ? 'error' : 'updated'; ?> notice is-dismissible"><p><?php echo implode( "</p><p>", $messages); ?></p></div>667 <?php if ( ! empty( $messages ) ) : ?> 668 <div id="moderated" class="<?php echo esc_attr( ( $is_error ) ? 'error' : 'updated' ); ?> notice is-dismissible"><p><?php echo implode( "</p><p>", array_map( 'esc_html', $messages ) ); ?></p></div> 666 669 <?php endif; ?> 667 670 … … 675 678 <div id="postdiv"> 676 679 <div id="bp_groups_name" class="groupbox"> 677 <h2><?php _e( 'Name and Description', 'buddypress' ); ?></h2>680 <h2><?php esc_html_e( 'Name and Description', 'buddypress' ); ?></h2> 678 681 <div class="inside"> 679 <label for="bp-groups-name" class="screen-reader-text"><?php 680 /* translators: accessibility text */ 681 _e( 'Group Name', 'buddypress' ); 682 ?></label> 682 <label for="bp-groups-name" class="screen-reader-text"> 683 <?php 684 /* translators: accessibility text */ 685 esc_html_e( 'Group Name', 'buddypress' ); 686 ?> 687 </label> 683 688 <input type="text" name="bp-groups-name" id="bp-groups-name" value="<?php echo esc_attr( stripslashes( $group_name ) ) ?>" /> 684 689 <div id="bp-groups-permalink-box"> … … 690 695 </div> 691 696 692 <label for="bp-groups-description" class="screen-reader-text"><?php 693 /* translators: accessibility text */ 694 _e( 'Group Description', 'buddypress' ); 695 ?></label> 697 <label for="bp-groups-description" class="screen-reader-text"> 698 <?php 699 /* translators: accessibility text */ 700 esc_html_e( 'Group Description', 'buddypress' ); 701 ?> 702 </label> 696 703 <?php wp_editor( stripslashes( $group->description ), 'bp-groups-description', array( 'media_buttons' => false, 'teeny' => true, 'textarea_rows' => 5, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?> 697 704 </div> … … 718 725 <?php else : ?> 719 726 720 <p><?php 721 printf( 722 '%1$s <a href="%2$s">%3$s</a>', 723 __( 'No group found with this ID.', 'buddypress' ), 724 esc_url( bp_get_admin_url( 'admin.php?page=bp-groups' ) ), 725 __( 'Go back and try again.', 'buddypress' ) 726 ); 727 ?></p> 727 <p> 728 <?php 729 printf( 730 '%1$s <a href="%2$s">%3$s</a>', 731 esc_html__( 'No group found with this ID.', 'buddypress' ), 732 esc_url( bp_get_admin_url( 'admin.php?page=bp-groups' ) ), 733 esc_html__( 'Go back and try again.', 'buddypress' ) 734 ); 735 ?> 736 </p> 728 737 729 738 <?php endif; ?> … … 765 774 } 766 775 767 $base_url 776 $base_url = remove_query_arg( array( 'action', 'action2', 'paged', 's', '_wpnonce', 'gid' ), $_SERVER['REQUEST_URI'] ); ?> 768 777 769 778 <div class="wrap"> 770 <h1 class="wp-heading-inline"><?php _e( 'Delete Groups', 'buddypress' ) ?></h1>779 <h1 class="wp-heading-inline"><?php esc_html_e( 'Delete Groups', 'buddypress' ) ?></h1> 771 780 <hr class="wp-header-end"> 772 781 773 <p><?php _e( 'You are about to delete the following groups:', 'buddypress' ) ?></p>782 <p><?php esc_html_e( 'You are about to delete the following groups:', 'buddypress' ) ?></p> 774 783 775 784 <ul class="bp-group-delete-list"> … … 779 788 </ul> 780 789 781 <p><strong><?php _e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p>782 783 <a class="button-primary" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'do_delete', 'gid' => implode( ',', $gids ) ), $base_url ), 'bp-groups-delete' ) ); ?>"><?php _e( 'Delete Permanently', 'buddypress' ) ?></a>784 <a class="button" href="<?php echo esc_attr( $base_url ); ?>"><?php _e( 'Cancel', 'buddypress' ) ?></a>790 <p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p> 791 792 <a class="button-primary" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'do_delete', 'gid' => implode( ',', $gids ) ), $base_url ), 'bp-groups-delete' ) ); ?>"><?php esc_html_e( 'Delete Permanently', 'buddypress' ) ?></a> 793 <a class="button" href="<?php echo esc_attr( $base_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a> 785 794 </div> 786 795 … … 830 839 <div class="wrap"> 831 840 832 <h1 class="wp-heading-inline"><?php _e( 'Groups', 'buddypress' ); ?></h1>841 <h1 class="wp-heading-inline"><?php esc_html_e( 'Groups', 'buddypress' ); ?></h1> 833 842 834 843 <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?> … … 836 845 <?php endif; ?> 837 846 838 <?php if ( ! empty( $_REQUEST['s'] ) ) : ?>839 <span class="subtitle"><?php printf( __( 'Search results for “%s”', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50) ); ?></span>847 <?php if ( ! empty( $_REQUEST['s'] ) ) : ?> 848 <span class="subtitle"><?php printf( esc_html__( 'Search results for “%s”', 'buddypress' ), esc_html( wp_html_excerpt( stripslashes( $_REQUEST['s'] ), 50 ) ) ); ?></span> 840 849 <?php endif; ?> 841 850 … … 843 852 844 853 <?php // If the user has just made a change to an group, display the status messages. ?> 845 <?php if ( ! empty( $messages ) ) : ?>846 <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?> notice is-dismissible"><p><?php echo implode( "<br/>\n", $messages); ?></p></div>854 <?php if ( ! empty( $messages ) ) : ?> 855 <div id="moderated" class="<?php echo esc_attr( ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated' ); ?> notice is-dismissible"><p><?php echo implode( "<br/>\n", array_map( 'esc_html', $messages ) ); ?></p></div> 847 856 <?php endif; ?> 848 857 … … 851 860 852 861 <form id="bp-groups-form" action="" method="get"> 853 <?php $bp_groups_list_table->search_box( __( 'Search all Groups', 'buddypress' ), 'bp-groups' ); ?>862 <?php $bp_groups_list_table->search_box( esc_html__( 'Search all Groups', 'buddypress' ), 'bp-groups' ); ?> 854 863 <input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" /> 855 864 <?php $bp_groups_list_table->display(); ?> … … 874 883 <?php if ( bp_is_active( 'forums' ) ) : ?> 875 884 <div class="bp-groups-settings-section" id="bp-groups-settings-section-forum"> 876 <label for="group-show-forum"><input type="checkbox" name="group-show-forum" id="group-show-forum" <?php checked( $item->enable_forum ) ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ) ?></label>885 <label for="group-show-forum"><input type="checkbox" name="group-show-forum" id="group-show-forum" <?php checked( $item->enable_forum ) ?> /> <?php esc_html_e( 'Enable discussion forum', 'buddypress' ) ?></label> 877 886 </div> 878 887 <?php endif; ?> … … 880 889 <div class="bp-groups-settings-section" id="bp-groups-settings-section-status"> 881 890 <fieldset> 882 <legend><?php _e( 'Privacy', 'buddypress' ); ?></legend>883 884 <label for="bp-group-status-public"><input type="radio" name="group-status" id="bp-group-status-public" value="public" <?php checked( $item->status, 'public' ) ?> /><?php _e( 'Public', 'buddypress' ) ?></label>885 <label for="bp-group-status-private"><input type="radio" name="group-status" id="bp-group-status-private" value="private" <?php checked( $item->status, 'private' ) ?> /><?php _e( 'Private', 'buddypress' ) ?></label>886 <label for="bp-group-status-hidden"><input type="radio" name="group-status" id="bp-group-status-hidden" value="hidden" <?php checked( $item->status, 'hidden' ) ?> /><?php _e( 'Hidden', 'buddypress' ) ?></label>891 <legend><?php esc_html_e( 'Privacy', 'buddypress' ); ?></legend> 892 893 <label for="bp-group-status-public"><input type="radio" name="group-status" id="bp-group-status-public" value="public" <?php checked( $item->status, 'public' ) ?> /><?php esc_html_e( 'Public', 'buddypress' ) ?></label> 894 <label for="bp-group-status-private"><input type="radio" name="group-status" id="bp-group-status-private" value="private" <?php checked( $item->status, 'private' ) ?> /><?php esc_html_e( 'Private', 'buddypress' ) ?></label> 895 <label for="bp-group-status-hidden"><input type="radio" name="group-status" id="bp-group-status-hidden" value="hidden" <?php checked( $item->status, 'hidden' ) ?> /><?php esc_html_e( 'Hidden', 'buddypress' ) ?></label> 887 896 </fieldset> 888 897 </div> … … 890 899 <div class="bp-groups-settings-section" id="bp-groups-settings-section-invite-status"> 891 900 <fieldset> 892 <legend><?php _e( 'Who can invite others to this group?', 'buddypress' ); ?></legend>893 894 <label for="bp-group-invite-status-members"><input type="radio" name="group-invite-status" id="bp-group-invite-status-members" value="members" <?php checked( $invite_status, 'members' ) ?> /><?php _e( 'All group members', 'buddypress' ) ?></label>895 <label for="bp-group-invite-status-mods"><input type="radio" name="group-invite-status" id="bp-group-invite-status-mods" value="mods" <?php checked( $invite_status, 'mods' ) ?> /><?php _e( 'Group admins and mods only', 'buddypress' ) ?></label>896 <label for="bp-group-invite-status-admins"><input type="radio" name="group-invite-status" id="bp-group-invite-status-admins" value="admins" <?php checked( $invite_status, 'admins' ) ?> /><?php _e( 'Group admins only', 'buddypress' ) ?></label>901 <legend><?php esc_html_e( 'Who can invite others to this group?', 'buddypress' ); ?></legend> 902 903 <label for="bp-group-invite-status-members"><input type="radio" name="group-invite-status" id="bp-group-invite-status-members" value="members" <?php checked( $invite_status, 'members' ) ?> /><?php esc_html_e( 'All group members', 'buddypress' ) ?></label> 904 <label for="bp-group-invite-status-mods"><input type="radio" name="group-invite-status" id="bp-group-invite-status-mods" value="mods" <?php checked( $invite_status, 'mods' ) ?> /><?php esc_html_e( 'Group admins and mods only', 'buddypress' ) ?></label> 905 <label for="bp-group-invite-status-admins"><input type="radio" name="group-invite-status" id="bp-group-invite-status-admins" value="admins" <?php checked( $invite_status, 'admins' ) ?> /><?php esc_html_e( 'Group admins only', 'buddypress' ) ?></label> 897 906 </fieldset> 898 907 </div> … … 919 928 ?> 920 929 921 <label for="bp-groups-new-members" class="screen-reader-text"><?php 922 /* translators: accessibility text */ 923 _e( 'Add new members', 'buddypress' ); 924 ?></label> 930 <label for="bp-groups-new-members" class="screen-reader-text"> 931 <?php 932 /* translators: accessibility text */ 933 esc_html_e( 'Add new members', 'buddypress' ); 934 ?> 935 </label> 925 936 <input name="bp-groups-new-members" type="text" id="bp-groups-new-members" class="<?php echo esc_attr( $class ); ?>" placeholder="" /> 926 937 <?php if ( $notice ) : ?> … … 1007 1018 <div class="bp-groups-member-type" id="bp-groups-member-type-<?php echo esc_attr( $member_type ) ?>"> 1008 1019 1009 <h3><?php switch ( $member_type ) : 1020 <h3> 1021 <?php 1022 switch ( $member_type ) : 1010 1023 case 'admin' : esc_html_e( 'Administrators', 'buddypress' ); break; 1011 1024 case 'mod' : esc_html_e( 'Moderators', 'buddypress' ); break; 1012 1025 case 'member' : esc_html_e( 'Members', 'buddypress' ); break; 1013 1026 case 'banned' : esc_html_e( 'Banned Members', 'buddypress' ); break; 1014 endswitch; ?></h3> 1027 endswitch; 1028 ?> 1029 </h3> 1015 1030 1016 1031 <div class="bp-group-admin-pagination table-top"> 1017 <?php echo $pagination[ $member_type ] ?> 1032 <?php 1033 // phpcs:ignore WordPress.Security.EscapeOutput 1034 echo $pagination[ $member_type ]; 1035 ?> 1018 1036 </div> 1019 1037 1020 <?php if ( ! empty( $type_users ) ) : ?>1038 <?php if ( ! empty( $type_users ) ) : ?> 1021 1039 1022 1040 <table class="widefat bp-group-members"> 1023 1041 <thead> 1024 1042 <tr> 1025 <th scope="col" class="uid-column"><?php _ex( 'ID', 'Group member user_id in group admin', 'buddypress' ); ?></th>1026 <th scope="col" class="uname-column"><?php _ex( 'Name', 'Group member name in group admin', 'buddypress' ); ?></th>1027 <th scope="col" class="urole-column"><?php _ex( 'Group Role', 'Group member role in group admin', 'buddypress' ); ?></th>1043 <th scope="col" class="uid-column"><?php echo esc_html_x( 'ID', 'Group member user_id in group admin', 'buddypress' ); ?></th> 1044 <th scope="col" class="uname-column"><?php echo esc_html_x( 'Name', 'Group member name in group admin', 'buddypress' ); ?></th> 1045 <th scope="col" class="urole-column"><?php echo esc_html_x( 'Group Role', 'Group member role in group admin', 'buddypress' ); ?></th> 1028 1046 </tr> 1029 1047 </thead> … … 1036 1054 1037 1055 <td class="uname-column"> 1038 <a style="float: left;" href="<?php echo bp_members_get_user_url( $type_user->ID ); ?>"><?php echo bp_core_fetch_avatar( array( 1039 'item_id' => $type_user->ID, 1040 'width' => '32', 1041 'height' => '32' 1042 ) ); ?></a> 1043 1044 <span style="margin: 8px; float: left;"><?php echo bp_core_get_userlink( $type_user->ID ); ?></span> 1056 <a style="float: left;" href="<?php echo esc_url( bp_members_get_user_url( $type_user->ID ) ); ?>"> 1057 <?php 1058 // phpcs:ignore WordPress.Security.EscapeOutput 1059 echo bp_core_fetch_avatar( 1060 array( 1061 'item_id' => $type_user->ID, 1062 'width' => '32', 1063 'height' => '32' 1064 ) 1065 ); 1066 ?> 1067 </a> 1068 1069 <span style="margin: 8px; float: left;"> 1070 <?php 1071 // phpcs:ignore WordPress.Security.EscapeOutput 1072 echo bp_core_get_userlink( $type_user->ID ); 1073 ?> 1074 </span> 1045 1075 </td> 1046 1076 1047 1077 <td class="urole-column"> 1048 <label for="bp-groups-role-<?php echo esc_attr( $type_user->ID ); ?>" class="screen-reader-text"><?php 1049 /* translators: accessibility text */ 1050 _e( 'Select group role for member', 'buddypress' ); 1051 ?></label> 1078 <label for="bp-groups-role-<?php echo esc_attr( $type_user->ID ); ?>" class="screen-reader-text"> 1079 <?php 1080 /* translators: accessibility text */ 1081 esc_html_e( 'Select group role for member', 'buddypress' ); 1082 ?> 1083 </label> 1052 1084 <select class="bp-groups-role" id="bp-groups-role-<?php echo esc_attr( $type_user->ID ); ?>" name="bp-groups-role[<?php echo esc_attr( $type_user->ID ); ?>]"> 1053 1085 <optgroup label="<?php esc_attr_e( 'Roles', 'buddypress' ); ?>"> 1054 1086 <option class="admin" value="admin" <?php selected( 'admin', $member_type ); ?>><?php esc_html_e( 'Administrator', 'buddypress' ); ?></option> 1055 <option class="mod" value="mod" <?php selected( 'mod', $member_type ); ?>><?php esc_html_e( 'Moderator', 'buddypress' ); ?></option> 1056 <option class="member" value="member" <?php selected( 'member', $member_type ); ?>><?php esc_html_e( 'Member', 'buddypress' ); ?></option> 1087 <option class="mod" value="mod" <?php selected( 'mod', $member_type ); ?>><?php esc_html_e( 'Moderator', 'buddypress' ); ?></option> 1088 <option class="member" value="member" <?php selected( 'member', $member_type ); ?>><?php esc_html_e( 'Member', 'buddypress' ); ?></option> 1089 1057 1090 <?php if ( 'banned' === $member_type ) : ?> 1058 <option class="banned" value="banned" <?php selected( 'banned', $member_type ); ?>><?php esc_html_e( 'Banned','buddypress' ); ?></option>1091 <option class="banned" value="banned" <?php selected( 'banned', $member_type ); ?>><?php esc_html_e( 'Banned', 'buddypress' ); ?></option> 1059 1092 <?php endif; ?> 1093 1060 1094 </optgroup> 1061 1095 <optgroup label="<?php esc_attr_e( 'Actions', 'buddypress' ); ?>"> 1062 1096 <option class="remove" value="remove"><?php esc_html_e( 'Remove', 'buddypress' ); ?></option> 1097 1063 1098 <?php if ( 'banned' !== $member_type ) : ?> 1064 1099 <option class="banned" value="banned"><?php esc_html_e( 'Ban', 'buddypress' ); ?></option> 1065 1100 <?php endif; ?> 1101 1066 1102 </optgroup> 1067 1103 </select> … … 1121 1157 */ 1122 1158 function bp_groups_admin_edit_metabox_status( $item ) { 1123 $base_url = add_query_arg( array( 1124 'page' => 'bp-groups', 1125 'gid' => $item->id 1126 ), bp_get_admin_url( 'admin.php' ) ); ?> 1159 $base_url = add_query_arg( 1160 array( 1161 'page' => 'bp-groups', 1162 'gid' => $item->id 1163 ), 1164 bp_get_admin_url( 'admin.php' ) 1165 ); 1166 ?> 1127 1167 1128 1168 <div id="submitcomment" class="submitbox"> 1129 1169 <div id="major-publishing-actions"> 1130 1170 <div id="delete-action"> 1131 <a class="submitdelete deletion" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'action', 'delete', $base_url ), 'bp-groups-delete' ) ); ?>"><?php _e( 'Delete Group', 'buddypress' ) ?></a>1171 <a class="submitdelete deletion" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'action', 'delete', $base_url ), 'bp-groups-delete' ) ); ?>"><?php esc_html_e( 'Delete Group', 'buddypress' ) ?></a> 1132 1172 </div> 1133 1173 … … 1161 1201 ?> 1162 1202 1163 <label for="bp-groups-group-type" class="screen-reader-text"><?php 1164 /* translators: accessibility text */ 1165 esc_html_e( 'Select group type', 'buddypress' ); 1166 ?></label> 1203 <label for="bp-groups-group-type" class="screen-reader-text"> 1204 <?php 1205 /* translators: accessibility text */ 1206 esc_html_e( 'Select group type', 'buddypress' ); 1207 ?> 1208 </label> 1167 1209 1168 1210 <ul class="categorychecklist form-no-clear"> … … 1265 1307 $current_page_end = $page * $per_page > intval( $query->total_users ) ? $query->total_users : $page * $per_page; 1266 1308 1267 $pag_links = paginate_links( array( 1268 'base' => add_query_arg( $qs_key, '%#%', $url_base ), 1269 'format' => '', 1270 'prev_text' => __( '«', 'buddypress' ), 1271 'next_text' => __( '»', 'buddypress' ), 1272 'total' => ceil( $query->total_users / $per_page ), 1273 'current' => $page, 1274 ) ); 1309 $pag_links = paginate_links( 1310 array( 1311 'base' => add_query_arg( $qs_key, '%#%', $url_base ), 1312 'format' => '', 1313 'prev_text' => __( '«', 'buddypress' ), 1314 'next_text' => __( '»', 'buddypress' ), 1315 'total' => ceil( $query->total_users / $per_page ), 1316 'current' => $page, 1317 ) 1318 ); 1275 1319 1276 1320 if ( 1 == $query->total_users ) { … … 1286 1330 } 1287 1331 1288 $pagination .= '<span class="bp-group-admin-pagination-viewing">' . $viewing_text . '</span>'; 1332 $pagination .= '<span class="bp-group-admin-pagination-viewing">' . esc_html( $viewing_text ) . '</span>'; 1333 1334 // phpcs:ignore WordPress.Security.EscapeOutput 1289 1335 $pagination .= '<span class="bp-group-admin-pagination-links">' . $pag_links . '</span>'; 1290 1336 … … 1331 1377 } 1332 1378 1333 $suggestions = bp_core_get_suggestions( array( 1334 'group_id' => -$group_id, // A negative value will exclude this group's members from the suggestions. 1335 'limit' => 10, 1336 'term' => $term, 1337 'type' => 'members', 1338 ) ); 1379 $suggestions = bp_core_get_suggestions( 1380 array( 1381 'group_id' => -$group_id, // A negative value will exclude this group's members from the suggestions. 1382 'limit' => 10, 1383 'term' => $term, 1384 'type' => 'members', 1385 ) 1386 ); 1339 1387 1340 1388 $matches = array(); -
trunk/src/bp-groups/bp-groups-blocks.php
r13716 r13808 349 349 350 350 // Include the common JS template. 351 // phpcs:ignore WordPress.Security.EscapeOutput 351 352 echo bp_get_dynamic_template_part( 'assets/widgets/dynamic-groups.php' ); 352 353 -
trunk/src/bp-groups/bp-groups-functions.php
r13619 r13808 330 330 // Backward compatibility with old method of passing arguments. 331 331 if ( ! is_array( $args ) || count( $function_args ) > 1 ) { 332 _deprecated_argument( __METHOD__, '2.9.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );332 _deprecated_argument( __METHOD__, '2.9.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 333 333 334 334 $old_args_keys = array( … … 813 813 if ( ! is_array( $args ) || count( $function_args ) > 1 ) { 814 814 /* translators: 1: the name of the method. 2: the name of the file. */ 815 _deprecated_argument( __METHOD__, '2.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );815 _deprecated_argument( __METHOD__, '2.0.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 816 816 817 817 $old_args_keys = array( … … 1832 1832 // Backward compatibility with old method of passing arguments. 1833 1833 if ( ! is_array( $args[0] ) || count( $args ) > 1 ) { 1834 _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );1834 _deprecated_argument( __METHOD__, '5.0.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 1835 1835 1836 1836 $old_args_keys = array( … … 2048 2048 function groups_demote_member( $user_id, $group_id ) { 2049 2049 2050 if ( ! bp_is_item_admin() ) 2050 if ( ! bp_is_item_admin() ) { 2051 2051 return false; 2052 } 2052 2053 2053 2054 $member = new BP_Groups_Member( $user_id, $group_id ); … … 2077 2078 function groups_ban_member( $user_id, $group_id ) { 2078 2079 2079 if ( ! bp_is_item_admin() ) 2080 if ( ! bp_is_item_admin() ) { 2080 2081 return false; 2082 } 2081 2083 2082 2084 $member = new BP_Groups_Member( $user_id, $group_id ); … … 2106 2108 function groups_unban_member( $user_id, $group_id ) { 2107 2109 2108 if ( ! bp_is_item_admin() ) 2110 if ( ! bp_is_item_admin() ) { 2109 2111 return false; 2112 } 2110 2113 2111 2114 $member = new BP_Groups_Member( $user_id, $group_id ); … … 2176 2179 // Backward compatibility with old method of passing arguments. 2177 2180 if ( ! is_array( $args[0] ) || count( $args ) > 1 ) { 2178 _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );2181 _deprecated_argument( __METHOD__, '5.0.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 2179 2182 2180 2183 $old_args_keys = array( … … 2251 2254 if ( ! empty( $membership_id ) ) { 2252 2255 /* translators: 1: the name of the method. 2: the name of the file. */ 2253 _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );2256 _deprecated_argument( __METHOD__, '5.0.0', sprintf( esc_html__( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 2254 2257 } 2255 2258 … … 2285 2288 if ( ! empty( $membership_id ) ){ 2286 2289 /* translators: 1: the name of the method. 2: the name of the file. */ 2287 _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );2290 _deprecated_argument( __METHOD__, '5.0.0', sprintf( esc_html__( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 2288 2291 } 2289 2292 … … 2323 2326 if ( ! empty( $membership_id ) ){ 2324 2327 /* translators: 1: the name of the method. 2: the name of the file. */ 2325 _deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );2328 _deprecated_argument( __METHOD__, '5.0.0', sprintf( esc_html__( 'Argument `membership_id` passed to %1$s is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 2326 2329 } 2327 2330 … … 2643 2646 */ 2644 2647 function bp_group_type_tax_name() { 2645 echo bp_get_group_type_tax_name();2648 echo esc_html( bp_get_group_type_tax_name() ); 2646 2649 } 2647 2650 … … 2878 2881 2879 2882 if ( isset( $bp->groups->types[ $group_type ] ) ) { 2880 return new WP_Error( 'bp_group_type_exists', __( 'Group type already exists.', 'buddypress' ), $group_type );2883 return new WP_Error( 'bp_group_type_exists', esc_html__( 'Group type already exists.', 'buddypress' ), $group_type ); 2881 2884 } 2882 2885 -
trunk/src/bp-groups/bp-groups-notifications.php
r13503 r13808 1161 1161 function groups_screen_notification_settings() { 1162 1162 1163 if ( ! $group_invite = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_invite', true ) )1163 if ( ! $group_invite = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_invite', true ) ) { 1164 1164 $group_invite = 'yes'; 1165 1166 if ( !$group_update = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_group_updated', true ) ) 1165 } 1166 1167 if ( ! $group_update = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_group_updated', true ) ) { 1167 1168 $group_update = 'yes'; 1168 1169 if ( !$group_promo = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_admin_promotion', true ) ) 1169 } 1170 1171 if ( ! $group_promo = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_admin_promotion', true ) ) { 1170 1172 $group_promo = 'yes'; 1171 1172 if ( !$group_request = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_membership_request', true ) ) 1173 } 1174 1175 if ( ! $group_request = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_membership_request', true ) ) { 1173 1176 $group_request = 'yes'; 1177 } 1174 1178 1175 1179 if ( ! $group_request_completed = bp_get_user_meta( bp_displayed_user_id(), 'notification_membership_request_completed', true ) ) { … … 1182 1186 <tr> 1183 1187 <th class="icon"></th> 1184 <th class="title"><?php _ex( 'Groups', 'Group settings on notification settings page', 'buddypress' ) ?></th>1185 <th class="yes"><?php _e( 'Yes', 'buddypress' ) ?></th>1186 <th class="no"><?php _e( 'No', 'buddypress' )?></th>1188 <th class="title"><?php echo esc_html_x( 'Groups', 'Group settings on notification settings page', 'buddypress' ) ?></th> 1189 <th class="yes"><?php esc_html_e( 'Yes', 'buddypress' ) ?></th> 1190 <th class="no"><?php esc_html_e( 'No', 'buddypress' )?></th> 1187 1191 </tr> 1188 1192 </thead> … … 1191 1195 <tr id="groups-notification-settings-invitation"> 1192 1196 <td></td> 1193 <td><?php _ex( 'A member invites you to join a group', 'group settings on notification settings page','buddypress' ) ?></td>1197 <td><?php echo esc_html_x( 'A member invites you to join a group', 'group settings on notification settings page','buddypress' ) ?></td> 1194 1198 <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" id="notification-groups-invite-yes" value="yes" <?php checked( $group_invite, 'yes', true ) ?>/><label for="notification-groups-invite-yes" class="bp-screen-reader-text"><?php 1195 1199 /* translators: accessibility text */ 1196 _e( 'Yes, send email', 'buddypress' );1200 esc_html_e( 'Yes, send email', 'buddypress' ); 1197 1201 ?></label></td> 1198 1202 <td class="no"><input type="radio" name="notifications[notification_groups_invite]" id="notification-groups-invite-no" value="no" <?php checked( $group_invite, 'no', true ) ?>/><label for="notification-groups-invite-no" class="bp-screen-reader-text"><?php 1199 1203 /* translators: accessibility text */ 1200 _e( 'No, do not send email', 'buddypress' );1204 esc_html_e( 'No, do not send email', 'buddypress' ); 1201 1205 ?></label></td> 1202 1206 </tr> 1203 1207 <tr id="groups-notification-settings-info-updated"> 1204 1208 <td></td> 1205 <td><?php _ex( 'Group information is updated', 'group settings on notification settings page', 'buddypress' ) ?></td>1209 <td><?php echo esc_html_x( 'Group information is updated', 'group settings on notification settings page', 'buddypress' ) ?></td> 1206 1210 <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" id="notification-groups-group-updated-yes" value="yes" <?php checked( $group_update, 'yes', true ) ?>/><label for="notification-groups-group-updated-yes" class="bp-screen-reader-text"><?php 1207 1211 /* translators: accessibility text */ 1208 _e( 'Yes, send email', 'buddypress' );1212 esc_html_e( 'Yes, send email', 'buddypress' ); 1209 1213 ?></label></td> 1210 1214 <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" id="notification-groups-group-updated-no" value="no" <?php checked( $group_update, 'no', true ) ?>/><label for="notification-groups-group-updated-no" class="bp-screen-reader-text"><?php 1211 1215 /* translators: accessibility text */ 1212 _e( 'No, do not send email', 'buddypress' );1216 esc_html_e( 'No, do not send email', 'buddypress' ); 1213 1217 ?></label></td> 1214 1218 </tr> 1215 1219 <tr id="groups-notification-settings-promoted"> 1216 1220 <td></td> 1217 <td><?php _ex( 'You are promoted to a group administrator or moderator', 'group settings on notification settings page', 'buddypress' ) ?></td>1221 <td><?php echo esc_html_x( 'You are promoted to a group administrator or moderator', 'group settings on notification settings page', 'buddypress' ) ?></td> 1218 1222 <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" id="notification-groups-admin-promotion-yes" value="yes" <?php checked( $group_promo, 'yes', true ) ?>/><label for="notification-groups-admin-promotion-yes" class="bp-screen-reader-text"><?php 1219 1223 /* translators: accessibility text */ 1220 _e( 'Yes, send email', 'buddypress' );1224 esc_html_e( 'Yes, send email', 'buddypress' ); 1221 1225 ?></label></td> 1222 1226 <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" id="notification-groups-admin-promotion-no" value="no" <?php checked( $group_promo, 'no', true ) ?>/><label for="notification-groups-admin-promotion-no" class="bp-screen-reader-text"><?php 1223 1227 /* translators: accessibility text */ 1224 _e( 'No, do not send email', 'buddypress' );1228 esc_html_e( 'No, do not send email', 'buddypress' ); 1225 1229 ?></label></td> 1226 1230 </tr> 1227 1231 <tr id="groups-notification-settings-request"> 1228 1232 <td></td> 1229 <td><?php _ex( 'A member requests to join a private group for which you are an admin', 'group settings on notification settings page', 'buddypress' ) ?></td>1233 <td><?php echo esc_html_x( 'A member requests to join a private group for which you are an admin', 'group settings on notification settings page', 'buddypress' ) ?></td> 1230 1234 <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" id="notification-groups-membership-request-yes" value="yes" <?php checked( $group_request, 'yes', true ) ?>/><label for="notification-groups-membership-request-yes" class="bp-screen-reader-text"><?php 1231 1235 /* translators: accessibility text */ 1232 _e( 'Yes, send email', 'buddypress' );1236 esc_html_e( 'Yes, send email', 'buddypress' ); 1233 1237 ?></label></td> 1234 1238 <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" id="notification-groups-membership-request-no" value="no" <?php checked( $group_request, 'no', true ) ?>/><label for="notification-groups-membership-request-no" class="bp-screen-reader-text"><?php 1235 1239 /* translators: accessibility text */ 1236 _e( 'No, do not send email', 'buddypress' );1240 esc_html_e( 'No, do not send email', 'buddypress' ); 1237 1241 ?></label></td> 1238 1242 </tr> 1239 1243 <tr id="groups-notification-settings-request-completed"> 1240 1244 <td></td> 1241 <td><?php _ex( 'Your request to join a group has been approved or denied', 'group settings on notification settings page', 'buddypress' ) ?></td>1245 <td><?php echo esc_html_x( 'Your request to join a group has been approved or denied', 'group settings on notification settings page', 'buddypress' ) ?></td> 1242 1246 <td class="yes"><input type="radio" name="notifications[notification_membership_request_completed]" id="notification-groups-membership-request-completed-yes" value="yes" <?php checked( $group_request_completed, 'yes', true ) ?>/><label for="notification-groups-membership-request-completed-yes" class="bp-screen-reader-text"><?php 1243 1247 /* translators: accessibility text */ 1244 _e( 'Yes, send email', 'buddypress' );1248 esc_html_e( 'Yes, send email', 'buddypress' ); 1245 1249 ?></label></td> 1246 1250 <td class="no"><input type="radio" name="notifications[notification_membership_request_completed]" id="notification-groups-membership-request-completed-no" value="no" <?php checked( $group_request_completed, 'no', true ) ?>/><label for="notification-groups-membership-request-completed-no" class="bp-screen-reader-text"><?php 1247 1251 /* translators: accessibility text */ 1248 _e( 'No, do not send email', 'buddypress' );1252 esc_html_e( 'No, do not send email', 'buddypress' ); 1249 1253 ?></label></td> 1250 1254 </tr> -
trunk/src/bp-groups/bp-groups-template.php
r13548 r13808 17 17 */ 18 18 function bp_groups_slug() { 19 echo bp_get_groups_slug();19 echo esc_url( bp_get_groups_slug() ); 20 20 } 21 21 /** … … 44 44 */ 45 45 function bp_groups_root_slug() { 46 echo bp_get_groups_root_slug();46 echo esc_url( bp_get_groups_root_slug() ); 47 47 } 48 48 /** … … 227 227 */ 228 228 function bp_group_type_directory_link( $group_type = '' ) { 229 // phpcs:ignore WordPress.Security.EscapeOutput 229 230 echo bp_get_group_type_directory_link( $group_type ); 230 231 } … … 269 270 * @since 2.7.0 270 271 * @see bp_get_group_type_list() for parameter documentation. 272 * 273 * @param integer $group_id The group ID. 274 * @param array $r List parameters. 271 275 */ 272 276 function bp_group_type_list( $group_id = 0, $r = array() ) { 277 // phpcs:ignore WordPress.Security.EscapeOutput 273 278 echo bp_get_group_type_list( $group_id, $r ); 274 279 } … … 657 662 */ 658 663 function bp_group_id( $group = false ) { 659 echo bp_get_group_id( $group);664 echo intval( bp_get_group_id( $group ) ); 660 665 } 661 666 /** … … 696 701 */ 697 702 function bp_group_class( $classes = array() ) { 703 // phpcs:ignore WordPress.Security.EscapeOutput 698 704 echo bp_get_group_class( $classes ); 699 705 } … … 764 770 * @param array $classes Array of determined classes for the row. 765 771 */ 766 $classes = a pply_filters( 'bp_get_group_class', $classes);772 $classes = array_map( 'sanitize_html_class', apply_filters( 'bp_get_group_class', $classes ) ); 767 773 $classes = array_merge( $classes, array() ); 768 774 $retval = 'class="' . join( ' ', $classes ) . '"'; … … 780 786 */ 781 787 function bp_group_name( $group = false ) { 788 // Escaping is made in `bp-groups/bp-groups-filters.php`. 789 // phpcs:ignore WordPress.Security.EscapeOutput 782 790 echo bp_get_group_name( $group ); 783 791 } … … 820 828 */ 821 829 function bp_group_type( $group = false ) { 822 echo bp_get_group_type( $group);830 echo esc_html( bp_get_group_type( $group ) ); 823 831 } 824 832 /** … … 870 878 */ 871 879 function bp_group_status( $group = false ) { 872 echo bp_get_group_status( $group);880 echo esc_html( bp_get_group_status( $group ) ); 873 881 } 874 882 /** … … 914 922 */ 915 923 function bp_group_avatar( $args = '', $group = false ) { 924 // phpcs:ignore WordPress.Security.EscapeOutput 916 925 echo bp_get_group_avatar( $args, $group ); 917 926 } … … 1018 1027 */ 1019 1028 function bp_group_avatar_thumb( $group = false ) { 1029 // phpcs:ignore WordPress.Security.EscapeOutput 1020 1030 echo bp_get_group_avatar_thumb( $group ); 1021 1031 } … … 1048 1058 */ 1049 1059 function bp_group_avatar_mini( $group = false ) { 1060 // phpcs:ignore WordPress.Security.EscapeOutput 1050 1061 echo bp_get_group_avatar_mini( $group ); 1051 1062 } … … 1082 1093 */ 1083 1094 function bp_group_avatar_url( $group = false, $type = 'full' ) { 1084 echo bp_get_group_avatar_url( $group, $type);1095 echo esc_url( bp_get_group_avatar_url( $group, $type ) ); 1085 1096 } 1086 1097 /** … … 1162 1173 */ 1163 1174 function bp_group_last_active( $group = false, $args = array() ) { 1164 echo bp_get_group_last_active( $group, $args);1175 echo esc_html( bp_get_group_last_active( $group, $args ) ); 1165 1176 } 1166 1177 /** … … 1309 1320 */ 1310 1321 function bp_group_link( $group = false ) { 1322 // phpcs:ignore WordPress.Security.EscapeOutput 1311 1323 echo bp_get_group_link( $group ); 1312 1324 } … … 1419 1431 */ 1420 1432 function bp_group_slug( $group = false ) { 1421 echo bp_get_group_slug( $group);1433 echo esc_url( bp_get_group_slug( $group ) ); 1422 1434 } 1423 1435 /** … … 1459 1471 */ 1460 1472 function bp_group_description( $group = false ) { 1473 // Escaping is made in `bp-groups/bp-groups-filters.php`. 1474 // phpcs:ignore WordPress.Security.EscapeOutput 1461 1475 echo bp_get_group_description( $group ); 1462 1476 } … … 1499 1513 */ 1500 1514 function bp_group_description_editable( $group = false ) { 1501 echo bp_get_group_description_editable( $group);1515 echo esc_textarea( bp_get_group_description_editable( $group ) ); 1502 1516 } 1503 1517 /** … … 1548 1562 */ 1549 1563 function bp_group_description_excerpt( $group = false, $length = 225 ) { 1564 // Escaping is made in `bp-groups/bp-groups-filters.php`. 1565 // phpcs:ignore WordPress.Security.EscapeOutput 1550 1566 echo bp_get_group_description_excerpt( $group, $length ); 1551 1567 } … … 1591 1607 */ 1592 1608 function bp_group_date_created( $group = false, $args = array() ) { 1593 echo bp_get_group_date_created( $group, $args);1609 echo esc_html( bp_get_group_date_created( $group, $args ) ); 1594 1610 } 1595 1611 /** … … 1650 1666 */ 1651 1667 function bp_group_creator_username( $group = false ) { 1668 // Escaping is made in `bp-members/bp-members-functions.php`. 1669 // phpcs:ignore WordPress.Security.EscapeOutput 1652 1670 echo bp_get_group_creator_username( $group ); 1653 1671 } … … 1690 1708 */ 1691 1709 function bp_group_creator_id( $group = false ) { 1692 echo bp_get_group_creator_id( $group);1710 echo intval( bp_get_group_creator_id( $group ) ); 1693 1711 } 1694 1712 /** … … 1730 1748 */ 1731 1749 function bp_group_creator_permalink( $group = false ) { 1732 echo bp_get_group_creator_permalink( $group);1750 echo esc_url( bp_get_group_creator_permalink( $group ) ); 1733 1751 } 1734 1752 /** … … 1800 1818 */ 1801 1819 function bp_group_creator_avatar( $group = false, $args = array() ) { 1820 // phpcs:ignore WordPress.Security.EscapeOutput 1802 1821 echo bp_get_group_creator_avatar( $group, $args ); 1803 1822 } … … 1911 1930 $group = bp_get_group( $group ); 1912 1931 1932 // phpcs:disable WordPress.Security.EscapeOutput 1913 1933 if ( ! empty( $group->admins ) ) { ?> 1914 1934 <ul id="group-admins"> … … 1943 1963 <?php } ?> 1944 1964 <?php 1965 // phpcs:enable 1945 1966 } 1946 1967 … … 1957 1978 $group = bp_get_group( $group ); 1958 1979 1980 // phpcs:disable WordPress.Security.EscapeOutput 1959 1981 if ( ! empty( $group->mods ) ) : 1960 1982 ?> … … 1989 2011 <?php 1990 2012 endif; 2013 // phpcs:enable 1991 2014 } 1992 2015 … … 2091 2114 */ 2092 2115 function bp_groups_pagination_links() { 2116 // Escaping is done in WordPress's `paginate_links()` function. 2117 // phpcs:ignore WordPress.Security.EscapeOutput 2093 2118 echo bp_get_groups_pagination_links(); 2094 2119 } … … 2121 2146 */ 2122 2147 function bp_groups_pagination_count() { 2123 echo bp_get_groups_pagination_count();2148 echo esc_html( bp_get_groups_pagination_count() ); 2124 2149 } 2125 2150 /** … … 2191 2216 */ 2192 2217 function bp_group_total_members( $group = false ) { 2193 echo bp_get_group_total_members( $group);2218 echo intval( bp_get_group_total_members( $group ) ); 2194 2219 } 2195 2220 /** … … 2231 2256 */ 2232 2257 function bp_group_member_count( $group = false ) { 2233 echo bp_get_group_member_count( $group);2258 echo esc_html( bp_get_group_member_count( $group ) ); 2234 2259 } 2235 2260 /** … … 2509 2534 */ 2510 2535 function bp_group_member_promote_mod_link( $args = '' ) { 2511 echo bp_get_group_member_promote_mod_link( $args);2536 echo esc_url( bp_get_group_member_promote_mod_link( $args ) ); 2512 2537 } 2513 2538 /** … … 2564 2589 */ 2565 2590 function bp_group_member_promote_admin_link( $args = '' ) { 2566 echo bp_get_group_member_promote_admin_link( $args);2591 echo esc_url( bp_get_group_member_promote_admin_link( $args ) ); 2567 2592 } 2568 2593 /** … … 2622 2647 */ 2623 2648 function bp_group_member_demote_link( $user_id = 0, $group = false ) { 2624 echo bp_get_group_member_demote_link( $user_id, $group);2649 echo esc_url( bp_get_group_member_demote_link( $user_id, $group ) ); 2625 2650 } 2626 2651 /** … … 2677 2702 */ 2678 2703 function bp_group_member_ban_link( $user_id = 0, $group = false ) { 2679 echo bp_get_group_member_ban_link( $user_id, $group);2704 echo esc_url( bp_get_group_member_ban_link( $user_id, $group ) ); 2680 2705 } 2681 2706 /** … … 2731 2756 */ 2732 2757 function bp_group_member_unban_link( $user_id = 0, $group = false ) { 2733 echo bp_get_group_member_unban_link( $user_id, $group);2758 echo esc_url( bp_get_group_member_unban_link( $user_id, $group ) ); 2734 2759 } 2735 2760 /** … … 2771 2796 * @param int $user_id The user ID. 2772 2797 */ 2773 return apply_filters( 'bp_get_group_member_unban_link', $url, $group,$user_id );2798 return apply_filters( 'bp_get_group_member_unban_link', $url, $group, $user_id ); 2774 2799 } 2775 2800 … … 2785 2810 */ 2786 2811 function bp_group_member_remove_link( $user_id = 0, $group = false ) { 2787 echo bp_get_group_member_remove_link( $user_id, $group);2812 echo esc_url( bp_get_group_member_remove_link( $user_id, $group ) ); 2788 2813 } 2789 2814 /** … … 2885 2910 2886 2911 if ( ! empty( $admin_tabs_backcompat ) ) { 2887 _doing_it_wrong( "do_action( 'groups_admin_tabs' )", __( 'This action should not be used directly. Please use the BuddyPress Group Extension API to generate Manage tabs.', 'buddypress' ), '2.2.0' );2912 _doing_it_wrong( "do_action( 'groups_admin_tabs' )", esc_html__( 'This action should not be used directly. Please use the BuddyPress Group Extension API to generate Manage tabs.', 'buddypress' ), '2.2.0' ); 2888 2913 $subnav_output .= $admin_tabs_backcompat; 2889 2914 } … … 2898 2923 */ 2899 2924 function bp_group_total_for_member() { 2900 echo bp_get_group_total_for_member();2925 echo intval( bp_get_group_total_for_member() ); 2901 2926 } 2902 2927 /** … … 2930 2955 */ 2931 2956 function bp_group_form_action( $page, $group = false ) { 2932 echo bp_get_group_form_action( $page, $group);2957 echo esc_url( bp_get_group_form_action( $page, $group ) ); 2933 2958 } 2934 2959 /** … … 2983 3008 */ 2984 3009 function bp_group_admin_form_action( $page = false, $group = false ) { 2985 echo bp_get_group_admin_form_action( $page, $group);3010 echo esc_url( bp_get_group_admin_form_action( $page, $group ) ); 2986 3011 } 2987 3012 /** … … 3185 3210 */ 3186 3211 function bp_group_accept_invite_link() { 3187 echo bp_get_group_accept_invite_link();3212 echo esc_url( bp_get_group_accept_invite_link() ); 3188 3213 } 3189 3214 /** … … 3233 3258 */ 3234 3259 function bp_group_reject_invite_link() { 3235 echo bp_get_group_reject_invite_link();3260 echo esc_url( bp_get_group_reject_invite_link() ); 3236 3261 } 3237 3262 /** … … 3281 3306 */ 3282 3307 function bp_group_leave_confirm_link() { 3283 echo bp_get_group_leave_confirm_link();3308 echo esc_url( bp_get_group_leave_confirm_link() ); 3284 3309 } 3285 3310 /** … … 3327 3352 */ 3328 3353 function bp_group_leave_reject_link() { 3329 echo bp_get_group_leave_reject_link();3354 echo esc_url( bp_get_group_leave_reject_link() ); 3330 3355 } 3331 3356 /** … … 3365 3390 */ 3366 3391 function bp_group_send_invite_form_action() { 3367 echo bp_get_group_send_invite_form_action();3392 echo esc_url( bp_get_group_send_invite_form_action() ); 3368 3393 } 3369 3394 /** … … 3439 3464 */ 3440 3465 function bp_group_join_button( $group = false ) { 3466 // Escaping is done in `BP_Core_HTML_Element()`. 3467 // phpcs:ignore WordPress.Security.EscapeOutput 3441 3468 echo bp_get_group_join_button( $group ); 3442 3469 } … … 3637 3664 */ 3638 3665 function bp_group_create_button() { 3666 // Escaping is done in `BP_Core_HTML_Element()`. 3667 // phpcs:ignore WordPress.Security.EscapeOutput 3639 3668 echo bp_get_group_create_button(); 3640 3669 } … … 3683 3712 */ 3684 3713 function bp_group_create_nav_item() { 3714 // Escaping is done in `BP_Core_HTML_Element()`. 3715 // phpcs:ignore WordPress.Security.EscapeOutput 3685 3716 echo bp_get_group_create_nav_item(); 3686 3717 } … … 3798 3829 * @param object $group Group to get status message for. 3799 3830 */ 3800 echo apply_filters( 'bp_group_status_message', $message, $group);3831 echo esc_html( apply_filters( 'bp_group_status_message', $message, $group ) ); 3801 3832 } 3802 3833 … … 3830 3861 */ 3831 3862 function bp_total_group_count() { 3832 echo bp_get_total_group_count();3863 echo intval( bp_get_total_group_count() ); 3833 3864 } 3834 3865 /** … … 3859 3890 */ 3860 3891 function bp_total_group_count_for_user( $user_id = 0 ) { 3861 echo bp_get_total_group_count_for_user( $user_id);3892 echo intval( bp_get_total_group_count_for_user( $user_id ) ); 3862 3893 } 3863 3894 /** … … 4016 4047 */ 4017 4048 function bp_group_member_avatar( $args = '' ) { 4049 // phpcs:ignore WordPress.Security.EscapeOutput 4018 4050 echo bp_get_group_member_avatar( $args ); 4019 4051 } … … 4061 4093 */ 4062 4094 function bp_group_member_avatar_thumb( $args = '' ) { 4095 // phpcs:ignore WordPress.Security.EscapeOutput 4063 4096 echo bp_get_group_member_avatar_thumb( $args ); 4064 4097 } … … 4107 4140 */ 4108 4141 function bp_group_member_avatar_mini( $width = 30, $height = 30 ) { 4142 // phpcs:ignore WordPress.Security.EscapeOutput 4109 4143 echo bp_get_group_member_avatar_mini( $width, $height ); 4110 4144 } … … 4153 4187 */ 4154 4188 function bp_group_member_name() { 4155 echo bp_get_group_member_name();4189 echo esc_html( bp_get_group_member_name() ); 4156 4190 } 4157 4191 /** … … 4183 4217 */ 4184 4218 function bp_group_member_url() { 4185 echo bp_get_group_member_url();4219 echo esc_url( bp_get_group_member_url() ); 4186 4220 } 4187 4221 /** … … 4213 4247 */ 4214 4248 function bp_group_member_link() { 4249 // phpcs:ignore WordPress.Security.EscapeOutput 4215 4250 echo bp_get_group_member_link(); 4216 4251 } … … 4234 4269 * @param string $value HTML link for the current user. 4235 4270 */ 4236 return apply_filters( 'bp_get_group_member_link', '<a href="' . bp_members_get_user_url( $members_template->member->user_id ) . '">' . $members_template->member->display_name. '</a>' );4271 return apply_filters( 'bp_get_group_member_link', '<a href="' . esc_url( bp_members_get_user_url( $members_template->member->user_id ) ) . '">' . esc_html( $members_template->member->display_name ) . '</a>' ); 4237 4272 } 4238 4273 … … 4243 4278 */ 4244 4279 function bp_group_member_domain() { 4245 echo bp_get_group_member_domain();4280 echo esc_url( bp_get_group_member_domain() ); 4246 4281 } 4247 4282 /** … … 4273 4308 */ 4274 4309 function bp_group_member_is_friend() { 4275 echo bp_get_group_member_is_friend();4310 echo esc_html( bp_get_group_member_is_friend() ); 4276 4311 } 4277 4312 /** … … 4311 4346 */ 4312 4347 function bp_group_member_is_banned() { 4348 // phpcs:ignore WordPress.Security.EscapeOutput 4313 4349 echo bp_get_group_member_is_banned(); 4314 4350 } … … 4355 4391 * @param string $value HTML class to add. 4356 4392 */ 4357 echo apply_filters( 'bp_group_member_css_class', 'banned-user');4393 echo esc_attr( apply_filters( 'bp_group_member_css_class', 'banned-user' ) ); 4358 4394 } 4359 4395 } … … 4369 4405 */ 4370 4406 function bp_group_member_joined_since( $args = array() ) { 4371 echo bp_get_group_member_joined_since( $args);4407 echo esc_html( bp_get_group_member_joined_since( $args ) ); 4372 4408 } 4373 4409 /** … … 4427 4463 */ 4428 4464 function bp_group_member_id() { 4429 echo bp_get_group_member_id();4465 echo intval( bp_get_group_member_id() ); 4430 4466 } 4431 4467 /** … … 4474 4510 */ 4475 4511 function bp_group_pag_id() { 4476 echo bp_get_group_pag_id();4512 echo esc_url( bp_get_group_pag_id() ); 4477 4513 } 4478 4514 /** … … 4499 4535 */ 4500 4536 function bp_group_member_pagination() { 4537 // Escaping is done in WordPress's `paginate_links()` function. 4538 // phpcs:ignore WordPress.Security.EscapeOutput 4501 4539 echo bp_get_group_member_pagination(); 4502 4540 wp_nonce_field( 'bp_groups_member_list', '_member_pag_nonce' ); … … 4530 4568 */ 4531 4569 function bp_group_member_pagination_count() { 4532 echo bp_get_group_member_pagination_count();4570 echo esc_html( bp_get_group_member_pagination_count() ); 4533 4571 } 4534 4572 /** … … 4575 4613 */ 4576 4614 function bp_group_member_admin_pagination() { 4615 // Escaping is done in WordPress's `paginate_links()` function. 4616 // phpcs:ignore WordPress.Security.EscapeOutput 4577 4617 echo bp_get_group_member_admin_pagination(); 4578 4618 wp_nonce_field( 'bp_groups_member_admin_list', '_member_admin_pag_nonce' ); … … 4707 4747 </div> 4708 4748 4709 <h2 class="bp-screen-reader-text"><?php 4710 /* translators: accessibility text */ 4711 _e( 'Members', 'buddypress' ); 4712 ?></h2> 4749 <h2 class="bp-screen-reader-text"> 4750 <?php 4751 /* translators: accessibility text */ 4752 esc_html_e( 'Members', 'buddypress' ); 4753 ?> 4754 </h2> 4713 4755 4714 4756 <div id="members-group-list" class="group_members dir-list"> … … 4728 4770 ?> 4729 4771 <li id="group_members-order-select" class="last filter"> 4730 <label for="group_members-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>4772 <label for="group_members-order-by"><?php esc_html_e( 'Order By:', 'buddypress' ); ?></label> 4731 4773 <select id="group_members-order-by"> 4732 <option value="last_joined"><?php _e( 'Newest', 'buddypress' ); ?></option>4733 <option value="first_joined"><?php _e( 'Oldest', 'buddypress' ); ?></option>4774 <option value="last_joined"><?php esc_html_e( 'Newest', 'buddypress' ); ?></option> 4775 <option value="first_joined"><?php esc_html_e( 'Oldest', 'buddypress' ); ?></option> 4734 4776 4735 4777 <?php if ( bp_is_active( 'activity' ) ) : ?> 4736 <option value="group_activity"><?php _e( 'Group Activity', 'buddypress' ); ?></option>4778 <option value="group_activity"><?php esc_html_e( 'Group Activity', 'buddypress' ); ?></option> 4737 4779 <?php endif; ?> 4738 4780 4739 <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>4781 <option value="alphabetical"><?php esc_html_e( 'Alphabetical', 'buddypress' ); ?></option> 4740 4782 4741 4783 <?php … … 4832 4874 } 4833 4875 4834 4876 // phpcs:ignore WordPress.Security.EscapeOutput 4835 4877 printf( '<li%1$s>%2$s</li>', $current_class, $step_name ); 4836 4878 $counter++; … … 4847 4889 4848 4890 /** 4891 * Output the group creation step's title. 4892 * 4849 4893 * @since 1.0.0 4850 4894 */ … … 4852 4896 $bp = buddypress(); 4853 4897 4854 /** 4855 * Filters the group creation stage title. 4856 * 4857 * @since 1.1.0 4858 * 4859 * @param string $value HTML markup for the group creation stage title. 4860 */ 4861 echo apply_filters( 'bp_group_creation_stage_title', '<span>— ' . $bp->groups->group_creation_steps[bp_get_groups_current_create_step()]['name'] . '</span>' ); 4862 } 4863 4864 /** 4898 // phpcs:ignore WordPress.Security.EscapeOutput 4899 echo apply_filters( 4900 /** 4901 * Filters the group creation stage title. 4902 * 4903 * @since 1.1.0 4904 * 4905 * @param string $value HTML markup for the group creation stage title. 4906 */ 4907 'bp_group_creation_stage_title', 4908 '<span>— ' . esc_html( $bp->groups->group_creation_steps[bp_get_groups_current_create_step()]['name'] ) . '</span>' 4909 ); 4910 } 4911 4912 /** 4913 * Output the group's creation form action URL. 4914 * 4865 4915 * @since 1.1.0 4866 4916 */ 4867 4917 function bp_group_creation_form_action() { 4868 echo bp_get_group_creation_form_action(); 4869 } 4870 4871 /** 4918 echo esc_url( bp_get_group_creation_form_action() ); 4919 } 4920 4921 /** 4922 * Get the group's creation form action URL. 4923 * 4872 4924 * @since 1.1.0 4873 4925 * 4874 * @return mixed|void4926 * @return string The group's creation form action URL. 4875 4927 */ 4876 4928 function bp_get_group_creation_form_action() { … … 4900 4952 4901 4953 /** 4954 * Check the requested creation step is the current one. 4955 * 4902 4956 * @since 1.1.0 4903 4957 * 4904 * @param string $step_slug 4958 * @param string $step_slug The group creation step's slug. 4905 4959 * 4906 4960 * @return bool … … 4917 4971 // If this the first step, we can just accept and return true. 4918 4972 $keys = array_keys( $bp->groups->group_creation_steps ); 4919 if ( ! bp_action_variable( 1 ) && array_shift( $keys ) == $step_slug ) {4973 if ( ! bp_action_variable( 1 ) && array_shift( $keys ) == $step_slug ) { 4920 4974 return true; 4921 4975 } … … 4923 4977 // Before allowing a user to see a group creation step we must make sure 4924 4978 // previous steps are completed. 4925 if ( ! bp_is_first_group_creation_step() ) {4926 if ( ! bp_are_previous_group_creation_steps_complete( $step_slug ) ) {4979 if ( ! bp_is_first_group_creation_step() ) { 4980 if ( ! bp_are_previous_group_creation_steps_complete( $step_slug ) ) { 4927 4981 return false; 4928 4982 } … … 4938 4992 4939 4993 /** 4994 * Check the requested creation step is completed. 4995 * 4940 4996 * @since 1.1.0 4941 4997 * 4942 * @param array $step_slugs 4998 * @param array $step_slugs The list of group creation step slugs. 4943 4999 * 4944 5000 * @return bool … … 4947 5003 $bp = buddypress(); 4948 5004 4949 if ( ! isset( $bp->groups->completed_create_steps ) ) {5005 if ( ! isset( $bp->groups->completed_create_steps ) ) { 4950 5006 return false; 4951 5007 } … … 4955 5011 4956 5012 foreach ( (array) $step_slugs as $step_slug ) { 4957 if ( ! in_array( $step_slug, $bp->groups->completed_create_steps ) ) {5013 if ( ! in_array( $step_slug, $bp->groups->completed_create_steps ) ) { 4958 5014 $found = false; 4959 5015 } … … 4969 5025 4970 5026 /** 5027 * Check previous steps compared to the requested creation step are completed. 5028 * 4971 5029 * @since 1.1.0 4972 5030 * 4973 * @param string $step_slug 5031 * @param string $step_slug The group creation step's slug. 4974 5032 * 4975 5033 * @return bool … … 5001 5059 5002 5060 /** 5061 * Outputs the new group ID. 5062 * 5003 5063 * @since 1.1.0 5004 5064 */ 5005 5065 function bp_new_group_id() { 5006 echo bp_get_new_group_id();5066 echo intval( bp_get_new_group_id() ); 5007 5067 } 5008 5068 … … 5029 5089 5030 5090 /** 5091 * Output the new group's name. 5092 * 5031 5093 * @since 1.1.0 5032 5094 */ 5033 5095 function bp_new_group_name() { 5096 // Escaping is made in `bp-groups/bp-groups-filters.php`. 5097 // phpcs:ignore WordPress.Security.EscapeOutput 5034 5098 echo bp_get_new_group_name(); 5035 5099 } 5036 5100 5037 5101 /** 5102 * Get the new group's name. 5103 * 5038 5104 * @since 1.1.0 5039 5105 * 5040 * @return mixed|void5106 * @return string The new group's name. 5041 5107 */ 5042 5108 function bp_get_new_group_name() { … … 5057 5123 5058 5124 /** 5125 * Output the new group's description. 5126 * 5059 5127 * @since 1.1.0 5060 5128 */ 5061 5129 function bp_new_group_description() { 5130 // Escaping is made in `bp-groups/bp-groups-filters.php`. 5131 // phpcs:ignore WordPress.Security.EscapeOutput 5062 5132 echo bp_get_new_group_description(); 5063 5133 } 5064 5134 5065 5135 /** 5136 * Get the new group's description. 5137 * 5066 5138 * @since 1.1.0 5067 5139 * 5068 * @return mixed|void5140 * @return string The new group's description. 5069 5141 */ 5070 5142 function bp_get_new_group_description() { … … 5085 5157 5086 5158 /** 5159 * Outputs 1 if the new group has a forum. 5160 * 5161 * @todo deprecate 5087 5162 * @since 1.1.0 5088 5163 */ 5089 5164 function bp_new_group_enable_forum() { 5090 echo bp_get_new_group_enable_forum(); 5091 } 5092 5093 /** 5165 echo intval( bp_get_new_group_enable_forum() ); 5166 } 5167 5168 /** 5169 * Checks whether a new group has a forum or not. 5170 * 5171 * @todo deprecate 5094 5172 * @since 1.1.0 5095 5173 * 5096 * @return int 5174 * @return int 1 if the new group has a forum. O otherwise. 5097 5175 */ 5098 5176 function bp_get_new_group_enable_forum() { … … 5113 5191 5114 5192 /** 5193 * Outputs the new group's status. 5194 * 5115 5195 * @since 1.1.0 5116 5196 */ 5117 5197 function bp_new_group_status() { 5118 echo bp_get_new_group_status(); 5119 } 5120 5121 /** 5198 echo esc_html( bp_get_new_group_status() ); 5199 } 5200 5201 /** 5202 * Gets the new group's status. 5203 * 5122 5204 * @since 1.1.0 5123 5205 * 5124 * @return mixed|void5206 * @return string The new group's status. 5125 5207 */ 5126 5208 function bp_get_new_group_status() { … … 5150 5232 */ 5151 5233 function bp_new_group_avatar( $args = '' ) { 5234 // phpcs:ignore WordPress.Security.EscapeOutput 5152 5235 echo bp_get_new_group_avatar( $args ); 5153 5236 } … … 5265 5348 */ 5266 5349 function bp_groups_current_create_step() { 5267 echo bp_get_groups_current_create_step();5350 echo esc_html( bp_get_groups_current_create_step() ); 5268 5351 } 5269 5352 /** … … 5374 5457 */ 5375 5458 function bp_new_group_invite_friend_list( $args = array() ) { 5459 // phpcs:ignore WordPress.Security.EscapeOutput 5376 5460 echo bp_get_new_group_invite_friend_list( $args ); 5377 5461 } … … 5461 5545 5462 5546 /** 5547 * Outputs a search form for the Groups directory. 5548 * 5463 5549 * @since 1.0.0 5464 5550 */ … … 5475 5561 $search_form_html = '<form action="" method="get" id="search-groups-form"> 5476 5562 <label for="groups_search"><input type="text" name="' . esc_attr( $query_arg ) . '" id="groups_search" placeholder="'. esc_attr( $search_value ) .'" /></label> 5477 <input type="submit" id="groups_search_submit" name="groups_search_submit" value="'. __( 'Search', 'buddypress' ) .'" />5563 <input type="submit" id="groups_search_submit" name="groups_search_submit" value="'. esc_html__( 'Search', 'buddypress' ) .'" /> 5478 5564 </form>'; 5479 5565 5480 /** 5481 * Filters the HTML markup for the groups search form. 5482 * 5483 * @since 1.9.0 5484 * 5485 * @param string $search_form_html HTML markup for the search form. 5486 */ 5487 echo apply_filters( 'bp_directory_groups_search_form', $search_form_html ); 5488 5566 // phpcs:ignore WordPress.Security.EscapeOutput 5567 echo apply_filters( 5568 /** 5569 * Filters the HTML markup for the groups search form. 5570 * 5571 * @since 1.9.0 5572 * 5573 * @param string $search_form_html HTML markup for the search form. 5574 */ 5575 'bp_directory_groups_search_form', 5576 $search_form_html 5577 ); 5489 5578 } 5490 5579 … … 5495 5584 */ 5496 5585 function bp_current_group_directory_type_message() { 5497 echo bp_get_current_group_directory_type_message();5586 echo wp_kses( bp_get_current_group_directory_type_message(), array( 'strong' => true ) ); 5498 5587 } 5499 5588 /** … … 5538 5627 */ 5539 5628 function bp_group_current_admin_tab() { 5540 echo bp_get_group_current_admin_tab();5629 echo esc_html( bp_get_group_current_admin_tab() ); 5541 5630 } 5542 5631 /** … … 5575 5664 */ 5576 5665 function bp_group_current_avatar( $type = 'thumb' ) { 5666 // phpcs:ignore WordPress.Security.EscapeOutput 5577 5667 echo bp_get_group_current_avatar( $type ); 5578 5668 } … … 5640 5730 5641 5731 /** 5732 * Outputs the URL to delete a group avatar. 5733 * 5642 5734 * @since 1.1.0 5643 5735 */ 5644 5736 function bp_group_avatar_delete_link() { 5645 echo bp_get_group_avatar_delete_link(); 5646 } 5647 5648 /** 5737 echo esc_url( bp_get_group_avatar_delete_link() ); 5738 } 5739 5740 /** 5741 * Gets the URL to delete a group avatar. 5742 * 5649 5743 * @since 1.1.0 5650 5744 * 5651 * @return mixed|void5745 * @return string The URL to delete a group avatar. 5652 5746 */ 5653 5747 function bp_get_group_avatar_delete_link() { … … 5672 5766 5673 5767 /** 5768 * Fires a hook to let 3rd party plugins add some html content to group's home page. 5769 * 5674 5770 * @since 1.0.0 5675 5771 */ … … 5679 5775 5680 5776 /** 5777 * Fires a hook to let 3rd party plugins add custom group admin tabs. 5778 * 5779 * @todo deprecate. 5681 5780 * @since 1.0.0 5682 5781 */ … … 5686 5785 5687 5786 /** 5787 * Fires a hook to let 3rd party plugins add custom group editable fields. 5788 * 5789 * @todo deprecate. 5688 5790 * @since 1.0.0 5689 5791 */ … … 5693 5795 5694 5796 /** 5797 * Fires a hook to let 3rd party plugins add custom group fields. 5798 * 5799 * @todo deprecate. 5695 5800 * @since 1.0.0 5696 5801 */ … … 5769 5874 global $requests_template; 5770 5875 5771 /** 5772 * Filters the requesting user's avatar thumbnail. 5773 * 5774 * @since 1.0.0 5775 * 5776 * @param string $value HTML markup for the user's avatar thumbnail. 5777 */ 5876 // phpcs:ignore WordPress.Security.EscapeOutput 5778 5877 echo apply_filters( 5878 /** 5879 * Filters the requesting user's avatar thumbnail. 5880 * 5881 * @since 1.0.0 5882 * 5883 * @param string $value HTML markup for the user's avatar thumbnail. 5884 */ 5779 5885 'bp_group_request_user_avatar_thumb', 5780 5886 bp_core_fetch_avatar( … … 5790 5896 5791 5897 /** 5898 * Outputs the URL to reject a group membership request. 5899 * 5792 5900 * @since 1.0.0 5793 5901 */ 5794 5902 function bp_group_request_reject_link() { 5795 echo bp_get_group_request_reject_link(); 5796 } 5797 5798 /** 5903 echo esc_url( bp_get_group_request_reject_link() ); 5904 } 5905 5906 /** 5907 * Gets the URL to reject a group membership request. 5908 * 5799 5909 * @since 1.2.6 5800 5910 * 5801 * @return mixed|void5911 * @return string The URL to reject a group membership request. 5802 5912 */ 5803 5913 function bp_get_group_request_reject_link() { … … 5827 5937 5828 5938 /** 5939 * Outputs the URL to accept a group membership request. 5940 * 5829 5941 * @since 1.0.0 5830 5942 */ 5831 5943 function bp_group_request_accept_link() { 5832 echo bp_get_group_request_accept_link(); 5833 } 5834 5835 /** 5944 echo esc_url( bp_get_group_request_accept_link() ); 5945 } 5946 5947 /** 5948 * Gets the URL to reject a group membership request. 5949 * 5836 5950 * @since 1.2.6 5837 * @return mixed|void 5951 * 5952 * @return string The URL to reject a group membership request. 5838 5953 */ 5839 5954 function bp_get_group_request_accept_link() { … … 5863 5978 5864 5979 /** 5980 * Outputs the link to reach the requesting user's profile page. 5981 * 5865 5982 * @since 1.0.0 5866 5983 */ 5867 5984 function bp_group_request_user_link() { 5985 // phpcs:ignore WordPress.Security.EscapeOutput 5868 5986 echo bp_get_group_request_user_link(); 5869 5987 } 5870 5988 5871 5989 /** 5990 * Gets the link to reach the requesting user's profile page. 5991 * 5872 5992 * @since 1.2.6 5873 5993 * 5874 * @return mixed|void5994 * @return string HTML output. 5875 5995 */ 5876 5996 function bp_get_group_request_user_link() { … … 5888 6008 5889 6009 /** 6010 * Outputs the elapsed time since the group membership request was made. 6011 * 5890 6012 * @since 1.0.0 5891 6013 */ … … 5893 6015 global $requests_template; 5894 6016 5895 /** 5896 * Filters the formatted time since membership was requested. 5897 * 5898 * @since 1.0.0 5899 * 5900 * @param string $value Formatted time since membership was requested. 5901 */ 5902 echo apply_filters( 5903 'bp_group_request_time_since_requested', 5904 /* translators: %s: human time diff */ 5905 sprintf( __( 'requested %s', 'buddypress' ), bp_core_time_since( $requests_template->request->date_modified ) ) 6017 // phpcs:ignore WordPress.Security.EscapeOutput 6018 echo esc_html( 6019 /** 6020 * Filters the formatted time since membership was requested. 6021 * 6022 * @since 1.0.0 6023 * 6024 * @param string $value Formatted time since membership was requested. 6025 */ 6026 apply_filters( 6027 'bp_group_request_time_since_requested', 6028 /* translators: %s: human time diff */ 6029 sprintf( __( 'requested %s', 'buddypress' ), bp_core_time_since( $requests_template->request->date_modified ) ) 6030 ) 5906 6031 ); 5907 6032 } 5908 6033 5909 6034 /** 6035 * Outputs the comment a member sent with their membership request. 6036 * 5910 6037 * @since 1.0.0 5911 6038 */ … … 5920 6047 * @param string $value Membership request comment left by user. 5921 6048 */ 5922 echo apply_filters( 'bp_group_request_comment', strip_tags(stripslashes( $requests_template->request->comments ) ) );6049 echo esc_html( apply_filters( 'bp_group_request_comment', stripslashes( $requests_template->request->comments ) ) ); 5923 6050 } 5924 6051 … … 5929 6056 */ 5930 6057 function bp_group_requests_pagination_links() { 6058 // Escaping is done in WordPress's `paginate_links()` function. 6059 // phpcs:ignore WordPress.Security.EscapeOutput 5931 6060 echo bp_get_group_requests_pagination_links(); 5932 6061 } … … 5957 6086 */ 5958 6087 function bp_group_requests_pagination_count() { 5959 echo bp_get_group_requests_pagination_count();6088 echo esc_html( bp_get_group_requests_pagination_count() ); 5960 6089 } 5961 6090 /** … … 6074 6203 */ 6075 6204 function bp_group_invite_item_id() { 6076 echo bp_get_group_invite_item_id();6205 echo esc_attr( bp_get_group_invite_item_id() ); 6077 6206 } 6078 6207 … … 6099 6228 */ 6100 6229 function bp_group_invite_user_avatar() { 6230 // phpcs:ignore WordPress.Security.EscapeOutput 6101 6231 echo bp_get_group_invite_user_avatar(); 6102 6232 } … … 6124 6254 */ 6125 6255 function bp_group_invite_user_link() { 6256 // phpcs:ignore WordPress.Security.EscapeOutput 6126 6257 echo bp_get_group_invite_user_link(); 6127 6258 } … … 6149 6280 */ 6150 6281 function bp_group_invite_user_last_active() { 6151 echo bp_get_group_invite_user_last_active();6282 echo esc_html( bp_get_group_invite_user_last_active() ); 6152 6283 } 6153 6284 … … 6174 6305 */ 6175 6306 function bp_group_invite_user_remove_invite_url() { 6176 echo bp_get_group_invite_user_remove_invite_url();6307 echo esc_url( bp_get_group_invite_user_remove_invite_url() ); 6177 6308 } 6178 6309 … … 6209 6340 */ 6210 6341 function bp_group_invite_pagination_links() { 6342 // Escaping is done in WordPress's `paginate_links()` function. 6343 // phpcs:ignore WordPress.Security.EscapeOutput 6211 6344 echo bp_get_group_invite_pagination_links(); 6212 6345 } … … 6238 6371 */ 6239 6372 function bp_group_invite_pagination_count() { 6240 echo bp_get_group_invite_pagination_count();6373 echo esc_html( bp_get_group_invite_pagination_count() ); 6241 6374 } 6242 6375 /** … … 6278 6411 if ( ! bp_is_active( 'groups' ) || ! bp_is_active( 'activity' ) || ! bp_is_group() ) { 6279 6412 return; 6280 } ?> 6281 6282 <link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ) ?> | <?php echo esc_attr( bp_get_current_group_name() ); ?> | <?php _e( 'Group Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_group_activity_feed_link() ?>" /> 6283 6284 <?php 6413 } 6414 ?> 6415 <link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ) ?> | <?php echo esc_attr( bp_get_current_group_name() ); ?> | <?php esc_html_e( 'Group Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_group_activity_feed_link(); ?>" /> 6416 <?php 6285 6417 } 6286 6418 add_action( 'bp_head', 'bp_groups_activity_feed' ); … … 6292 6424 */ 6293 6425 function bp_group_activity_feed_link() { 6294 echo bp_get_group_activity_feed_link();6426 echo esc_url( bp_get_group_activity_feed_link() ); 6295 6427 } 6296 6428 /** … … 6325 6457 */ 6326 6458 function bp_current_group_id() { 6327 echo bp_get_current_group_id();6459 echo intval( bp_get_current_group_id() ); 6328 6460 } 6329 6461 /** … … 6355 6487 */ 6356 6488 function bp_current_group_slug() { 6357 echo bp_get_current_group_slug();6489 echo esc_url( bp_get_current_group_slug() ); 6358 6490 } 6359 6491 /** … … 6385 6517 */ 6386 6518 function bp_current_group_name() { 6519 // Escaping is made in `bp-groups/bp-groups-filters.php`. 6520 // phpcs:ignore WordPress.Security.EscapeOutput 6387 6521 echo bp_get_current_group_name(); 6388 6522 } … … 6415 6549 */ 6416 6550 function bp_current_group_description() { 6551 // Escaping is made in `bp-groups/bp-groups-filters.php`. 6552 // phpcs:ignore WordPress.Security.EscapeOutput 6417 6553 echo bp_get_current_group_description(); 6418 6554 } … … 6461 6597 */ 6462 6598 function bp_groups_action_link( $action = '', $query_args = '', $nonce = false ) { 6463 echo bp_get_groups_action_link( $action, $query_args, $nonce);6599 echo esc_url( bp_get_groups_action_link( $action, $query_args, $nonce ) ); 6464 6600 } 6465 6601 /** … … 6531 6667 */ 6532 6668 function bp_groups_profile_stats( $args = '' ) { 6533 echo bp_groups_get_profile_stats( $args ); 6669 echo wp_kses( 6670 bp_groups_get_profile_stats( $args ), 6671 array( 6672 'li' => array( 'class' => true ), 6673 'div' => array( 'class' => true ), 6674 'strong' => true, 6675 'a' => array( 'href' => true ), 6676 ) 6677 ); 6534 6678 } 6535 6679 add_action( 'bp_members_admin_user_stats', 'bp_groups_profile_stats', 8, 1 ); -
trunk/src/bp-groups/bp-groups-widgets.php
r13481 r13808 12 12 defined( 'ABSPATH' ) || exit; 13 13 14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', __( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) );14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', esc_html__( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) ); -
trunk/src/bp-groups/classes/class-bp-group-extension.php
r13524 r13808 1330 1330 ob_end_clean(); 1331 1331 1332 // phpcs:ignore WordPress.Security.EscapeOutput 1332 1333 echo $this->maybe_add_submit_button( $screen ); 1333 1334 … … 1426 1427 return $screen . sprintf( 1427 1428 '<div id="%s"><input type="submit" name="save" value="%s" id="%s"></div>', 1428 'bp-group-edit-' . $this->slug. '-submit-wrapper',1429 $this->screens['edit']['submit_text'],1430 'bp-group-edit-' . $this->slug. '-submit'1429 'bp-group-edit-' . esc_attr( $this->slug ) . '-submit-wrapper', 1430 esc_attr( $this->screens['edit']['submit_text'] ), 1431 'bp-group-edit-' . esc_attr( $this->slug ) . '-submit' 1431 1432 ); 1432 1433 } -
trunk/src/bp-groups/classes/class-bp-groups-group-members-template.php
r13446 r13808 122 122 if ( ! is_array( $args ) || count( $function_args ) > 1 ) { 123 123 /* translators: 1: the name of the method. 2: the name of the file. */ 124 _deprecated_argument( __METHOD__, '2.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );124 _deprecated_argument( __METHOD__, '2.0.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 125 125 126 126 $old_args_keys = array( -
trunk/src/bp-groups/classes/class-bp-groups-invite-template.php
r13433 r13808 100 100 if ( ! is_array( $args ) || count( $function_args ) > 1 ) { 101 101 /* translators: 1: the name of the method. 2: the name of the file. */ 102 _deprecated_argument( __METHOD__, '2.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );102 _deprecated_argument( __METHOD__, '2.0.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 103 103 104 104 $old_args_keys = array( -
trunk/src/bp-groups/classes/class-bp-groups-list-table.php
r13650 r13808 251 251 */ 252 252 public function no_items() { 253 _e( 'No groups found.', 'buddypress' );253 esc_html_e( 'No groups found.', 'buddypress' ); 254 254 } 255 255 … … 262 262 $this->display_tablenav( 'top' ); ?> 263 263 264 <h2 class="screen-reader-text"><?php 265 /* translators: accessibility text */ 266 _e( 'Groups list', 'buddypress' ); 267 ?></h2> 268 269 <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0"> 264 <h2 class="screen-reader-text"> 265 <?php 266 /* translators: accessibility text */ 267 esc_html_e( 'Groups list', 'buddypress' ); 268 ?> 269 </h2> 270 271 <table class="wp-list-table <?php echo esc_attr( implode( ' ', $this->get_table_classes() ) ); ?>" cellspacing="0"> 270 272 <thead> 271 273 <tr> … … 334 336 * @param string $value ID of the current group being displayed. 335 337 */ 336 $row_classes = a pply_filters( 'bp_groups_admin_row_class', $row_classes, $item['id']);338 $row_classes = array_map( 'sanitize_html_class', apply_filters( 'bp_groups_admin_row_class', $row_classes, $item['id'] ) ); 337 339 $row_class = ' class="' . implode( ' ', $row_classes ) . '"'; 338 340 341 // phpcs:ignore WordPress.Security.EscapeOutput 339 342 echo '<tr' . $row_class . ' id="group-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $item['id'] ) . '">'; 343 344 // Escapes are made into `self::single_row_columns()`. 345 // phpcs:ignore WordPress.Security.EscapeOutput 340 346 echo $this->single_row_columns( $item ); 341 347 echo '</tr>'; … … 352 358 $url_base = bp_get_admin_url( 'admin.php?page=bp-groups' ); ?> 353 359 354 <h2 class="screen-reader-text"><?php 355 /* translators: accessibility text */ 356 _e( 'Filter groups list', 'buddypress' ); 357 ?></h2> 360 <h2 class="screen-reader-text"> 361 <?php 362 /* translators: accessibility text */ 363 esc_html_e( 'Filter groups list', 'buddypress' ); 364 ?> 365 </h2> 358 366 359 367 <ul class="subsubsub"> … … 365 373 sprintf( 366 374 '<span class="count">(%s)</span>', 367 number_format_i18n( $this->group_counts['all'])375 esc_html( number_format_i18n( $this->group_counts['all'] ) ) 368 376 ) 369 377 ); ?> … … 374 382 <?php printf( 375 383 /* translators: %s is the placeholder for the count html `<span class="count"/>` */ 376 _n( 'Public %s', 'Public %s', $this->group_counts['public'], 'buddypress'),384 esc_html( _n( 'Public %s', 'Public %s', $this->group_counts['public'], 'buddypress' ) ), 377 385 sprintf( 378 386 '<span class="count">(%s)</span>', 379 number_format_i18n( $this->group_counts['public'])387 esc_html( number_format_i18n( $this->group_counts['public'] ) ) 380 388 ) 381 389 ); ?> … … 386 394 <?php printf( 387 395 /* translators: %s is the placeholder for the count html `<span class="count"/>` */ 388 _n( 'Private %s', 'Private %s', $this->group_counts['private'], 'buddypress'),396 esc_html( _n( 'Private %s', 'Private %s', $this->group_counts['private'], 'buddypress' ) ), 389 397 sprintf( 390 398 '<span class="count">(%s)</span>', 391 number_format_i18n( $this->group_counts['private'])399 esc_html( number_format_i18n( $this->group_counts['private'] ) ) 392 400 ) 393 401 ); ?> … … 398 406 <?php printf( 399 407 /* translators: %s is the placeholder for the count html tag */ 400 _n( 'Hidden %s', 'Hidden %s', $this->group_counts['hidden'], 'buddypress'),408 esc_html( _n( 'Hidden %s', 'Hidden %s', $this->group_counts['hidden'], 'buddypress' ) ), 401 409 sprintf( 402 410 '<span class="count">(%s)</span>', 403 number_format_i18n( $this->group_counts['hidden'])411 esc_html( number_format_i18n( $this->group_counts['hidden'] ) ) 404 412 ) 405 413 ); ?> … … 546 554 public function column_cb( $item = array() ) { 547 555 /* translators: accessibility text */ 548 printf( '<label class="screen-reader-text" for="gid-%1$d">' . __( 'Select group %1$d', 'buddypress' ) . '</label><input type="checkbox" name="gid[]" value="%1$d" id="gid-%1$d" />', $item['id']);556 printf( '<label class="screen-reader-text" for="gid-%1$d">' . esc_html__( 'Select group %1$d', 'buddypress' ) . '</label><input type="checkbox" name="gid[]" value="%1$d" id="gid-%1$d" />', intval( $item['id'] ) ); 549 557 } 550 558 … … 639 647 $content = sprintf( '<strong><a href="%s">%s</a></strong>', esc_url( $edit_url ), $group_name ); 640 648 641 echo $avatar . ' ' . $content . ' ' . $this->row_actions( $actions ); 649 echo wp_kses( 650 $avatar, 651 array( 652 'img' => array( 653 'alt' => true, 654 'src' => true, 655 'srcset' => true, 656 'class' => true, 657 'height' => true, 658 'width' => true, 659 ) 660 ) 661 ); 662 // phpcs:ignore WordPress.Security.EscapeOutput 663 echo ' ' . $content . ' ' . $this->row_actions( $actions ); 642 664 } 643 665 … … 651 673 public function column_description( $item = array() ) { 652 674 653 /** 654 * Filters the markup for the Description column. 655 * 656 * @since 1.0.0 657 * 658 * @param string $value Markup for the Description column. 659 * @param array $item The current group item in the loop. 660 */ 661 echo apply_filters_ref_array( 'bp_get_group_description', array( $item['description'], $item ) ); 675 // phpcs:ignore WordPress.Security.EscapeOutput 676 echo apply_filters_ref_array( 677 /** 678 * Filters the markup for the Description column. 679 * 680 * @since 1.0.0 681 * 682 * @param string $value Markup for the Description column. 683 * @param array $item The current group item in the loop. 684 */ 685 'bp_get_group_description', 686 array( $item['description'], $item ) 687 ); 662 688 } 663 689 … … 695 721 * @parma array $item The current group item in the loop. 696 722 */ 697 echo apply_filters_ref_array( 'bp_groups_admin_get_group_status', array( $status_desc, $item) );723 echo esc_html( apply_filters_ref_array( 'bp_groups_admin_get_group_status', array( $status_desc, $item ) ) ); 698 724 } 699 725 … … 715 741 * 716 742 * @param int $count Markup for the number of Members column. 717 * @par maarray $item The current group item in the loop.718 */ 719 echo apply_filters_ref_array( 'bp_groups_admin_get_group_member_count', array( (int) $count, $item) );743 * @param array $item The current group item in the loop. 744 */ 745 echo intval( apply_filters_ref_array( 'bp_groups_admin_get_group_member_count', array( $count, $item ) ) ); 720 746 } 721 747 … … 736 762 * 737 763 * @param string $last_active Markup for the Last Active column. 738 * @par maarray $item The current group item in the loop.739 */ 740 echo apply_filters_ref_array( 'bp_groups_admin_get_group_last_active', array( $last_active, $item) );764 * @param array $item The current group item in the loop. 765 */ 766 echo esc_html( apply_filters_ref_array( 'bp_groups_admin_get_group_last_active', array( $last_active, $item ) ) ); 741 767 } 742 768 … … 805 831 remove_filter( 'bp_get_group_type_directory_permalink', array( $this, 'group_type_permalink_use_admin_filter' ), 10 ); 806 832 807 /** 808 * Filters the markup for the Group Type column. 809 * 810 * @since 2.7.0 811 * 812 * @param string $retval Markup for the Group Type column. 813 * @parma array $item The current group item in the loop. 814 */ 815 echo apply_filters_ref_array( 'bp_groups_admin_get_group_type_column', array( $retval, $item ) ); 833 // phpcs:ignore WordPress.Security.EscapeOutput 834 echo apply_filters_ref_array( 835 /** 836 * Filters the markup for the Group Type column. 837 * 838 * @since 2.7.0 839 * 840 * @param string $retval Markup for the Group Type column. 841 * @parma array $item The current group item in the loop. 842 */ 843 'bp_groups_admin_get_group_type_column', 844 array( $retval, $item ) 845 ); 816 846 } 817 847 … … 850 880 ?> 851 881 <div class="alignleft actions"> 852 <label class="screen-reader-text" for="<?php echo $id_name; ?>"><?php_e( 'Change group type to…', 'buddypress' ) ?></label>853 <select name="<?php echo $id_name; ?>" id="<?php echo $id_name; ?>" style="display:inline-block;float:none;">854 <option value=""><?php _e( 'Change group type to…', 'buddypress' ) ?></option>882 <label class="screen-reader-text" for="<?php echo esc_attr( $id_name ); ?>"><?php esc_html_e( 'Change group type to…', 'buddypress' ) ?></label> 883 <select name="<?php echo esc_attr( $id_name ); ?>" id="<?php echo esc_attr( $id_name ); ?>" style="display:inline-block;float:none;"> 884 <option value=""><?php esc_html_e( 'Change group type to…', 'buddypress' ) ?></option> 855 885 856 886 <?php foreach( $types as $type ) : ?> … … 860 890 <?php endforeach; ?> 861 891 862 <option value="remove_group_type"><?php _e( 'No Group Type', 'buddypress' ) ?></option>892 <option value="remove_group_type"><?php esc_html_e( 'No Group Type', 'buddypress' ) ?></option> 863 893 864 894 </select> -
trunk/src/bp-groups/classes/class-bp-groups-membership-requests-template.php
r13399 r13808 99 99 if ( ! is_array( $args ) || count( $function_args ) > 1 ) { 100 100 /* translators: 1: the name of the method. 2: the name of the file. */ 101 _deprecated_argument( __METHOD__, '2.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );101 _deprecated_argument( __METHOD__, '2.0.0', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 102 102 103 103 $old_args_keys = array( -
trunk/src/bp-groups/classes/class-bp-groups-template.php
r13399 r13808 139 139 // Backward compatibility with old method of passing arguments. 140 140 if ( ! is_array( $args[0] ) || count( $args ) > 1 ) { 141 _deprecated_argument( __METHOD__, '1.7', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );141 _deprecated_argument( __METHOD__, '1.7', sprintf( esc_html__( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); 142 142 143 143 $old_args_keys = array( -
trunk/src/bp-groups/classes/class-bp-groups-widget.php
r13481 r13808 12 12 defined( 'ABSPATH' ) || exit; 13 13 14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', __( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) );14 _deprecated_file( basename( __FILE__ ), '12.0.0', '', esc_html__( 'BuddyPress does not include Legacy Widgets anymore, you can restore it using the BP Classic plugin', 'buddypress' ) ); 15 15 16 16 /**
Note: See TracChangeset
for help on using the changeset viewer.