Ticket #8139: 8139.04.improveOutputSanitizationAndDoNouveau.patch
File 8139.04.improveOutputSanitizationAndDoNouveau.patch, 40.3 KB (added by , 4 years ago) |
---|
-
src/bp-members/bp-members-filters.php
diff --git src/bp-members/bp-members-filters.php src/bp-members/bp-members-filters.php index 617b968a1..74edc441b 100644
function bp_members_invitations_get_modified_registration_disabled_message() { 252 252 } 253 253 return $message; 254 254 } 255 256 /** 257 * Sanitize the invitation property output. 258 * 259 * @since 8.0.0 260 * 261 * @param int|string $value The value for the requested property. 262 * @param string $property The name of the requested property. 263 * @param string $context The context of display. 264 * @return int|string The sanitized value. 265 */ 266 function bp_members_sanitize_invitation_property( $value = '', $property = '', $context = 'html' ) { 267 if ( ! $property ) { 268 return ''; 269 } 270 271 switch ( $property ) { 272 case 'id': 273 case 'user_id': 274 case 'item_id': 275 case 'secondary_item_id': 276 case 'invite_sent': 277 case 'accepted': 278 $value = absint( $value ); 279 break; 280 case 'invitee_email': 281 $value = sanitize_email( $value ); 282 break; 283 case 'content': 284 $value = wp_kses( $value, array() ); 285 $value = wptexturize( $value ); 286 break; 287 288 default: 289 $value = 'attribute' === $context ? esc_attr( $value ) : esc_html( $value ); 290 break; 291 } 292 293 return $value; 294 } 295 add_filter( 'bp_the_members_invitation_property', 'bp_members_sanitize_invitation_property', 10, 3 ); -
src/bp-members/bp-members-template.php
diff --git src/bp-members/bp-members-template.php src/bp-members/bp-members-template.php index 5b4021329..fc53f4a87 100644
function bp_members_invitations_pagination_links() { 3083 3083 } 3084 3084 3085 3085 /** 3086 * Output the IDof the invitation currently being iterated on.3086 * Output the requested property of the invitation currently being iterated on. 3087 3087 * 3088 3088 * @since 8.0.0 3089 * 3090 * @param string $property The name of the property to display. 3091 * @param string $context The context of display. 3092 * Possible values are 'attribute' and 'html'. 3089 3093 */ 3090 function bp_the_members_invitation_property( $property ) { 3091 echo bp_get_the_members_invitation_property( $property ); 3094 function bp_the_members_invitation_property( $property = '', $context = 'html' ) { 3095 if ( ! $property ) { 3096 return; 3097 } 3098 3099 /** 3100 * Use this filter to sanitize the output. 3101 * 3102 * @since 8.0.0 3103 * 3104 * @param int|string $value The value for the requested property. 3105 * @param string $property The name of the requested property. 3106 * @param string $context The context of display. 3107 */ 3108 echo apply_filters( 'bp_the_members_invitation_property', bp_get_the_members_invitation_property( $property ), $property, $context ); 3092 3109 } 3093 3110 /** 3094 3111 * Return the value for a property of the network invitation currently being iterated on. … … function bp_members_invitations_send_invites_permalink( $user_id = 0 ) { 3447 3464 * @param int $user_id The user ID. 3448 3465 */ 3449 3466 return apply_filters( 'bp_get_members_invitations_send_invites_permalink', $retval, $user_id ); 3450 } 3451 No newline at end of file 3467 } -
src/bp-members/screens/send-invites.php
diff --git src/bp-members/screens/send-invites.php src/bp-members/screens/send-invites.php index cc78d33c3..8291f0913 100644
function bp_network_invitations_catch_send_action() { 74 74 $user_id = bp_displayed_user_id(); 75 75 bp_core_redirect( bp_get_members_invitations_send_invites_permalink( $user_id ) ); 76 76 } 77 add_action( 'bp_actions', 'bp_network_invitations_catch_send_action' ); 78 No newline at end of file 77 add_action( 'bp_actions', 'bp_network_invitations_catch_send_action' ); -
src/bp-templates/bp-legacy/buddypress/members/single/invitations/invitations-loop.php
diff --git src/bp-templates/bp-legacy/buddypress/members/single/invitations/invitations-loop.php src/bp-templates/bp-legacy/buddypress/members/single/invitations/invitations-loop.php index c02b7c56a..f73857cc8 100644
13 13 <thead> 14 14 <tr> 15 15 <th class="icon"></th> 16 <th class="bulk-select-all"><input id="select-all-invitations" type="checkbox"><label class="bp-screen-reader-text" for="select-all-invitations"><?php 17 /* translators: accessibility text */ 18 _e( 'Select all', 'buddypress' ); 19 ?></label></th> 20 <th class="title"><?php _e( 'Invitee', 'buddypress' ); ?></th> 21 <th class="content"><?php _e( 'Message', 'buddypress' ); ?></th> 22 <th class="sent"><?php _e( 'Sent', 'buddypress' ); ?></th> 23 <th class="accepted"><?php _e( 'Accepted', 'buddypress' ); ?></th> 24 <th class="date"><?php _e( 'Date Modified', 'buddypress' ); ?></th> 25 <th class="actions"><?php _e( 'Actions', 'buddypress' ); ?></th> 16 <th class="bulk-select-all"><input id="select-all-invitations" type="checkbox"> 17 <label class="bp-screen-reader-text" for="select-all-invitations"> 18 <?php 19 /* translators: accessibility text */ 20 esc_html_e( 'Select all', 'buddypress' ); 21 ?> 22 </label> 23 </th> 24 <th class="title"><?php esc_html_e( 'Invitee', 'buddypress' ); ?></th> 25 <th class="content"><?php esc_html_e( 'Message', 'buddypress' ); ?></th> 26 <th class="sent"><?php esc_html_e( 'Sent', 'buddypress' ); ?></th> 27 <th class="accepted"><?php esc_html_e( 'Accepted', 'buddypress' ); ?></th> 28 <th class="date"><?php esc_html_e( 'Date Modified', 'buddypress' ); ?></th> 29 <th class="actions"><?php esc_html_e( 'Actions', 'buddypress' ); ?></th> 26 30 </tr> 27 31 </thead> 28 32 … … 32 36 33 37 <tr> 34 38 <td></td> 35 <td class="bulk-select-check"><label for="<?php bp_the_members_invitation_property( 'id' ); ?>"><input id="<?php bp_the_members_invitation_property( 'id' ); ?>" type="checkbox" name="network_invitations[]" value="<?php bp_the_members_invitation_property( 'id' ); ?>" class="invitation-check"><span class="bp-screen-reader-text"><?php 36 /* translators: accessibility text */ 37 _e( 'Select this invitation', 'buddypress' ); 38 ?></span></label></td> 39 <td class="bulk-select-check"> 40 <label for="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>"> 41 <input id="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" type="checkbox" name="network_invitations[]" value="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" class="invitation-check"> 42 <span class="bp-screen-reader-text"> 43 <?php 44 /* translators: accessibility text */ 45 esc_html_e( 'Select this invitation', 'buddypress' ); 46 ?> 47 </span> 48 </label> 49 </td> 39 50 <td class="invitation-invitee"><?php bp_the_members_invitation_property( 'invitee_email' ); ?></td> 40 <td class="invitation-content"><?php wptexturize( bp_the_members_invitation_property( 'content' )); ?></td>51 <td class="invitation-content"><?php bp_the_members_invitation_property( 'content' ); ?></td> 41 52 <td class="invitation-sent"><?php bp_the_members_invitation_property( 'invite_sent' ); ?></td> 42 53 <td class="invitation-accepted"><?php bp_the_members_invitation_property( 'accepted' ); ?></td> 43 54 <td class="invitation-date-modified"><?php bp_the_members_invitation_property( 'date_modified' ); ?></td> -
src/bp-templates/bp-legacy/buddypress/members/single/invitations/list-invites.php
diff --git src/bp-templates/bp-legacy/buddypress/members/single/invitations/list-invites.php src/bp-templates/bp-legacy/buddypress/members/single/invitations/list-invites.php index f5a4ba80f..8e299f1d6 100644
10 10 11 11 <?php if ( bp_has_members_invitations() ) : ?> 12 12 13 <h2 class="bp-screen-reader-text"><?php 13 <h2 class="bp-screen-reader-text"> 14 <?php 14 15 /* translators: accessibility text */ 15 _e( 'Invitations', 'buddypress' ); 16 ?></h2> 16 esc_html_e( 'Invitations', 'buddypress' ); 17 ?> 18 </h2> 17 19 18 20 <div id="pag-top" class="pagination no-ajax"> 19 21 <div class="pag-count" id="invitations-count-top"> … … 39 41 40 42 <?php else : ?> 41 43 42 <p><?php _e( 'There are no invitations to display.', 'buddypress' ); ?></p>44 <p><?php esc_html_e( 'There are no invitations to display.', 'buddypress' ); ?></p> 43 45 44 46 <?php endif; -
src/bp-templates/bp-legacy/buddypress/members/single/invitations/send-invites.php
diff --git src/bp-templates/bp-legacy/buddypress/members/single/invitations/send-invites.php src/bp-templates/bp-legacy/buddypress/members/single/invitations/send-invites.php index c27f4abc6..937974568 100644
7 7 * @version 8.0.0 8 8 */ 9 9 ?> 10 <h2 class="bp-screen-reader-text"><?php 10 <h2 class="bp-screen-reader-text"> 11 <?php 11 12 /* translators: accessibility text */ 12 _e( 'Send Invitations', 'buddypress' ); 13 ?></h2> 13 esc_html_e( 'Send Invitations', 'buddypress' ); 14 ?> 15 </h2> 14 16 15 17 <form class="standard-form network-invitation-form" id="network-invitation-form" method="post"> 16 <label for="bp_network_invitation_invitee_email"><?php _e( 'Email address of new user', 'buddypress' ); ?></label>18 <label for="bp_network_invitation_invitee_email"><?php esc_html_e( 'Email address of new user', 'buddypress' ); ?></label> 17 19 <input id="bp_network_invitation_invitee_email" type="email" name="invitee_email" required="required"> 18 20 19 <label for="bp_network_invitation_message"><?php _e( 'Add a personalized message to the invitation (optional)', 'buddypress' ); ?></label>21 <label for="bp_network_invitation_message"><?php esc_html_e( 'Add a personalized message to the invitation (optional)', 'buddypress' ); ?></label> 20 22 <textarea id="bp_network_invitation_message" name="invite_message"></textarea> 21 23 22 24 <input type="hidden" name="action" value="send-invite"> -
src/bp-templates/bp-nouveau/buddypress/members/single/invitations.php
diff --git src/bp-templates/bp-nouveau/buddypress/members/single/invitations.php src/bp-templates/bp-nouveau/buddypress/members/single/invitations.php index 90211f0e2..1fd36bab1 100644
5 5 * @since 8.0.0 6 6 * @version 8.0.0 7 7 */ 8 // @TODO9 8 ?> 10 9 11 10 <nav class="<?php bp_nouveau_single_item_subnav_classes(); ?>" id="subnav" role="navigation" aria-label="<?php esc_attr_e( 'Groups menu', 'buddypress' ); ?>"> 12 11 <ul class="subnav"> 13 14 <?php if ( bp_is_my_profile() ) : ?> 15 16 <?php bp_get_template_part( 'members/single/parts/item-subnav' ); ?> 17 18 <?php endif; ?> 19 12 <?php bp_get_template_part( 'members/single/parts/item-subnav' ); ?> 20 13 </ul> 21 14 </nav><!-- .bp-navs --> 22 15 23 <?php bp_get_template_part( 'common/search-and-filters-bar' ); ?>24 eh?25 16 <?php 26 if ( 'sent-invites' === bp_current_action() ) { 27 echo "send invites"; 28 } else { 29 echo "default"; 30 } 17 switch ( bp_current_action() ) : 18 19 case 'send-invites' : 20 bp_get_template_part( 'members/single/invitations/send-invites' ); 21 break; 22 23 case 'list-invites' : 24 default : 25 bp_get_template_part( 'members/single/invitations/list-invites' ); 26 break; 27 28 endswitch; 31 29 -
src/bp-templates/bp-nouveau/buddypress/members/single/invitations/invitations-loop.php
diff --git src/bp-templates/bp-nouveau/buddypress/members/single/invitations/invitations-loop.php src/bp-templates/bp-nouveau/buddypress/members/single/invitations/invitations-loop.php index e69de29bb..48576e8cf 100644
1 <?php 2 /** 3 * BuddyPress - Membership Invitations Loop 4 * 5 * @since 8.0.0 6 * @version 8.0.0 7 */ 8 ?> 9 <form action="" method="post" id="invitations-bulk-management"> 10 <table class="invitations"> 11 <thead> 12 <tr> 13 <th class="icon"></th> 14 <th class="bulk-select-all"><input id="select-all-invitations" type="checkbox"><label class="bp-screen-reader-text" for="select-all-invitations"><?php 15 /* translators: accessibility text */ 16 esc_html_e( 'Select all', 'buddypress' ); 17 ?></label></th> 18 <th class="title"><?php esc_html_e( 'Invitee', 'buddypress' ); ?></th> 19 <th class="content"><?php esc_html_e( 'Message', 'buddypress' ); ?></th> 20 <th class="sent"><?php esc_html_e( 'Sent', 'buddypress' ); ?></th> 21 <th class="accepted"><?php esc_html_e( 'Accepted', 'buddypress' ); ?></th> 22 <th class="date"><?php esc_html_e( 'Date Modified', 'buddypress' ); ?></th> 23 <th class="actions"><?php esc_html_e( 'Actions', 'buddypress' ); ?></th> 24 </tr> 25 </thead> 26 27 <tbody> 28 29 <?php while ( bp_the_members_invitations() ) : bp_the_members_invitation(); ?> 30 31 <tr> 32 <td></td> 33 <td class="bulk-select-check"> 34 <label for="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>"> 35 <input id="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" type="checkbox" name="network_invitations[]" value="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" class="invitation-check"> 36 <span class="bp-screen-reader-text"> 37 <?php 38 /* translators: accessibility text */ 39 esc_html_e( 'Select this invitation', 'buddypress' ); 40 ?> 41 </span> 42 </label> 43 </td> 44 <td class="invitation-invitee"><?php bp_the_members_invitation_property( 'invitee_email' ); ?></td> 45 <td class="invitation-content"><?php bp_the_members_invitation_property( 'content' ); ?></td> 46 <td class="invitation-sent"><?php bp_the_members_invitation_property( 'invite_sent' ); ?></td> 47 <td class="invitation-accepted"><?php bp_the_members_invitation_property( 'accepted' ); ?></td> 48 <td class="invitation-date-modified"><?php bp_the_members_invitation_property( 'date_modified' ); ?></td> 49 <td class="invitation-actions"><?php bp_the_members_invitation_action_links(); ?></td> 50 </tr> 51 52 <?php endwhile; ?> 53 54 </tbody> 55 </table> 56 57 <div class="invitations-options-nav"> 58 <?php // @TODO //bp_invitations_bulk_management_dropdown(); ?> 59 </div><!-- .invitations-options-nav --> 60 61 <?php wp_nonce_field( 'invitations_bulk_nonce', 'invitations_bulk_nonce' ); ?> 62 </form> -
src/bp-templates/bp-nouveau/buddypress/members/single/invitations/list-invites.php
diff --git src/bp-templates/bp-nouveau/buddypress/members/single/invitations/list-invites.php src/bp-templates/bp-nouveau/buddypress/members/single/invitations/list-invites.php index e69de29bb..92d92879f 100644
1 <?php 2 /** 3 * BuddyPress - Pending Membership Invitations 4 * 5 * @since 8.0.0 6 * @version 8.0.0 7 */ 8 ?> 9 10 <?php if ( bp_has_members_invitations() ) : ?> 11 12 <h2 class="bp-screen-reader-text"> 13 <?php 14 /* translators: accessibility text */ 15 esc_html_e( 'Invitations', 'buddypress' ); 16 ?> 17 </h2> 18 19 <div id="pag-top" class="pagination no-ajax"> 20 <div class="pag-count" id="invitations-count-top"> 21 <?php bp_members_invitations_pagination_count(); ?> 22 </div> 23 24 <div class="pagination-links" id="invitations-pag-top"> 25 <?php bp_members_invitations_pagination_links(); ?> 26 </div> 27 </div> 28 29 <?php bp_get_template_part( 'members/single/invitations/invitations-loop' ); ?> 30 31 <div id="pag-bottom" class="pagination no-ajax"> 32 <div class="pag-count" id="invitations-count-bottom"> 33 <?php bp_members_invitations_pagination_count(); ?> 34 </div> 35 36 <div class="pagination-links" id="invitations-pag-bottom"> 37 <?php bp_members_invitations_pagination_links(); ?> 38 </div> 39 </div> 40 41 <?php else : ?> 42 43 <?php bp_nouveau_user_feedback( 'member-invites-none' ); ?> 44 45 <?php endif; -
src/bp-templates/bp-nouveau/buddypress/members/single/invitations/send-invites.php
diff --git src/bp-templates/bp-nouveau/buddypress/members/single/invitations/send-invites.php src/bp-templates/bp-nouveau/buddypress/members/single/invitations/send-invites.php index e69de29bb..8e4c21a6e 100644
1 <?php 2 /** 3 * BuddyPress - Send a Membership Invitation. 4 * 5 * @since 8.0.0 6 * @version 8.0.0 7 */ 8 ?> 9 <h2 class="bp-screen-reader-text"> 10 <?php 11 /* translators: accessibility text */ 12 esc_html_e( 'Send Invitation', 'buddypress' ); 13 ?> 14 </h2> 15 16 <p class="bp-feedback info"> 17 <span class="bp-icon" aria-hidden="true"></span> 18 <span class="bp-help-text"> 19 <?php esc_html_e( 'Submitting the form below will send a message to the person of your choice thanks to their email (as long as they are not yet a member of this site). By default the message contains an invitation link to join the site.', 'buddypress' ); ?> 20 <?php esc_html_e( 'You can use the optional multiline text field to customize this message.', 'buddypress' ); ?> 21 </span> 22 </p> 23 24 <form class="standard-form network-invitation-form" id="network-invitation-form" method="post"> 25 <label for="bp_network_invitation_invitee_email"> 26 <?php esc_html_e( 'Email', 'buddypress' ); ?> 27 <span class="bp-required-field-label"><?php esc_html_e( '(required)', 'buddypress' ); ?></span> 28 </label> 29 <input id="bp_network_invitation_invitee_email" type="email" name="invitee_email" required="required"> 30 31 <label for="bp_network_invitation_message"> 32 <?php esc_html_e( 'Optional: add a message to your invite.', 'buddypress' ); ?> 33 </label> 34 <textarea id="bp_network_invitation_message" name="invite_message"></textarea> 35 36 <input type="hidden" name="action" value="send-invite"> 37 38 <?php bp_nouveau_submit_button( 'member-send-invite' ); ?> 39 </form> -
src/bp-templates/bp-nouveau/includes/functions.php
diff --git src/bp-templates/bp-nouveau/includes/functions.php src/bp-templates/bp-nouveau/includes/functions.php index 25b9af487..32a5c25ce 100644
3 3 * Common functions 4 4 * 5 5 * @since 3.0.0 6 * @version 3.1.06 * @version 8.0.0 7 7 */ 8 8 9 9 // Exit if accessed directly. … … function bp_nouveau_theme_cover_image( $params = array() ) { 915 915 * All user feedback messages are available here 916 916 * 917 917 * @since 3.0.0 918 * @since 8.0.0 Adds the 'member-invites-none' feedback. 918 919 * 919 920 * @param string $feedback_id The ID of the message. 920 921 * … … function bp_nouveau_get_user_feedback( $feedback_id = '' ) { 927 928 * Use this filter to add your custom feedback messages. 928 929 * 929 930 * @since 3.0.0 931 * @since 8.0.0 Adds the 'member-invites-none' feedback. 930 932 * 931 933 * @param array $value The list of feedback messages. 932 934 */ 933 $feedback_messages = apply_filters( 'bp_nouveau_feedback_messages', array( 934 'registration-disabled' => array( 935 'type' => 'info', 936 'message' => __( 'Member registration is currently not allowed.', 'buddypress' ), 937 'before' => 'bp_before_registration_disabled', 938 'after' => 'bp_after_registration_disabled' 939 ), 940 'request-details' => array( 941 'type' => 'info', 942 'message' => __( 'Registering for this site is easy. Just fill in the fields below, and we\'ll get a new account set up for you in no time.', 'buddypress' ), 943 'before' => false, 944 'after' => false, 945 ), 946 'completed-confirmation' => array( 947 'type' => 'info', 948 'message' => __( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ), 949 'before' => 'bp_before_registration_confirmed', 950 'after' => 'bp_after_registration_confirmed', 951 ), 952 'directory-activity-loading' => array( 953 'type' => 'loading', 954 'message' => __( 'Loading the community updates. Please wait.', 'buddypress' ), 955 ), 956 'single-activity-loading' => array( 957 'type' => 'loading', 958 'message' => __( 'Loading the update. Please wait.', 'buddypress' ), 959 ), 960 'activity-loop-none' => array( 961 'type' => 'info', 962 'message' => __( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ), 963 ), 964 'blogs-loop-none' => array( 965 'type' => 'info', 966 'message' => __( 'Sorry, there were no sites found.', 'buddypress' ), 967 ), 968 'blogs-no-signup' => array( 969 'type' => 'info', 970 'message' => __( 'Site registration is currently disabled.', 'buddypress' ), 971 ), 972 'directory-blogs-loading' => array( 973 'type' => 'loading', 974 'message' => __( 'Loading the sites of the network. Please wait.', 'buddypress' ), 975 ), 976 'directory-groups-loading' => array( 977 'type' => 'loading', 978 'message' => __( 'Loading the groups of the community. Please wait.', 'buddypress' ), 979 ), 980 'groups-loop-none' => array( 981 'type' => 'info', 982 'message' => __( 'Sorry, there were no groups found.', 'buddypress' ), 983 ), 984 'group-activity-loading' => array( 985 'type' => 'loading', 986 'message' => __( 'Loading the group updates. Please wait.', 'buddypress' ), 987 ), 988 'group-members-loading' => array( 989 'type' => 'loading', 990 'message' => __( 'Requesting the group members. Please wait.', 'buddypress' ), 991 ), 992 'group-members-none' => array( 993 'type' => 'info', 994 'message' => __( 'Sorry, there were no group members found.', 'buddypress' ), 995 ), 996 'group-members-search-none' => array( 997 'type' => 'info', 998 'message' => __( 'Sorry, there was no member of that name found in this group.', 'buddypress' ), 999 ), 1000 'group-manage-members-none' => array( 1001 'type' => 'info', 1002 'message' => __( 'This group has no members.', 'buddypress' ), 1003 ), 1004 'group-requests-none' => array( 1005 'type' => 'info', 1006 'message' => __( 'There are no pending membership requests.', 'buddypress' ), 1007 ), 1008 'group-requests-loading' => array( 1009 'type' => 'loading', 1010 'message' => __( 'Loading the members who requested to join the group. Please wait.', 'buddypress' ), 1011 ), 1012 'group-delete-warning' => array( 1013 'type' => 'warning', 1014 'message' => __( 'WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back. Please be careful with this option.', 'buddypress' ), 1015 ), 1016 'group-avatar-delete-info' => array( 1017 'type' => 'info', 1018 'message' => __( 'If you\'d like to remove the existing group profile photo but not upload a new one, please use the delete group profile photo button.', 'buddypress' ), 1019 ), 1020 'directory-members-loading' => array( 1021 'type' => 'loading', 1022 'message' => __( 'Loading the members of your community. Please wait.', 'buddypress' ), 1023 ), 1024 'members-loop-none' => array( 1025 'type' => 'info', 1026 'message' => __( 'Sorry, no members were found.', 'buddypress' ), 1027 ), 1028 'member-requests-none' => array( 1029 'type' => 'info', 1030 'message' => __( 'You have no pending friendship requests.', 'buddypress' ), 1031 ), 1032 'member-invites-none' => array( 1033 'type' => 'info', 1034 'message' => __( 'You have no outstanding group invites.', 'buddypress' ), 1035 ), 1036 'member-notifications-none' => array( 1037 'type' => 'info', 1038 'message' => __( 'This member has no notifications.', 'buddypress' ), 1039 ), 1040 'member-wp-profile-none' => array( 1041 'type' => 'info', 1042 /* translators: %s: member name */ 1043 'message' => __( '%s did not save any profile information yet.', 'buddypress' ), 1044 ), 1045 'member-delete-account' => array( 1046 'type' => 'warning', 1047 'message' => __( 'Deleting this account will delete all of the content it has created. It will be completely unrecoverable.', 'buddypress' ), 1048 ), 1049 'member-activity-loading' => array( 1050 'type' => 'loading', 1051 'message' => __( 'Loading the member\'s updates. Please wait.', 'buddypress' ), 1052 ), 1053 'member-blogs-loading' => array( 1054 'type' => 'loading', 1055 'message' => __( 'Loading the member\'s blogs. Please wait.', 'buddypress' ), 1056 ), 1057 'member-friends-loading' => array( 1058 'type' => 'loading', 1059 'message' => __( 'Loading the member\'s friends. Please wait.', 'buddypress' ), 1060 ), 1061 'member-groups-loading' => array( 1062 'type' => 'loading', 1063 'message' => __( 'Loading the member\'s groups. Please wait.', 'buddypress' ), 1064 ), 1065 'member-notifications-loading' => array( 1066 'type' => 'loading', 1067 'message' => __( 'Loading notifications. Please wait.', 'buddypress' ), 1068 ), 1069 'member-group-invites-all' => array( 1070 'type' => 'info', 1071 'message' => __( 'Currently every member of the community can invite you to join their groups. If you are not comfortable with it, you can always restrict group invites to your friends only.', 'buddypress' ), 1072 ), 1073 'member-group-invites-friends-only' => array( 1074 'type' => 'info', 1075 'message' => __( 'Currently only your friends can invite you to groups. Uncheck the box to allow any member to send invites.', 'buddypress' ), 1076 ), 1077 ) ); 935 $feedback_messages = apply_filters( 936 'bp_nouveau_feedback_messages', 937 array( 938 'registration-disabled' => array( 939 'type' => 'info', 940 'message' => __( 'Member registration is currently not allowed.', 'buddypress' ), 941 'before' => 'bp_before_registration_disabled', 942 'after' => 'bp_after_registration_disabled' 943 ), 944 'request-details' => array( 945 'type' => 'info', 946 'message' => __( 'Registering for this site is easy. Just fill in the fields below, and we\'ll get a new account set up for you in no time.', 'buddypress' ), 947 'before' => false, 948 'after' => false, 949 ), 950 'completed-confirmation' => array( 951 'type' => 'info', 952 'message' => __( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ), 953 'before' => 'bp_before_registration_confirmed', 954 'after' => 'bp_after_registration_confirmed', 955 ), 956 'directory-activity-loading' => array( 957 'type' => 'loading', 958 'message' => __( 'Loading the community updates. Please wait.', 'buddypress' ), 959 ), 960 'single-activity-loading' => array( 961 'type' => 'loading', 962 'message' => __( 'Loading the update. Please wait.', 'buddypress' ), 963 ), 964 'activity-loop-none' => array( 965 'type' => 'info', 966 'message' => __( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ), 967 ), 968 'blogs-loop-none' => array( 969 'type' => 'info', 970 'message' => __( 'Sorry, there were no sites found.', 'buddypress' ), 971 ), 972 'blogs-no-signup' => array( 973 'type' => 'info', 974 'message' => __( 'Site registration is currently disabled.', 'buddypress' ), 975 ), 976 'directory-blogs-loading' => array( 977 'type' => 'loading', 978 'message' => __( 'Loading the sites of the network. Please wait.', 'buddypress' ), 979 ), 980 'directory-groups-loading' => array( 981 'type' => 'loading', 982 'message' => __( 'Loading the groups of the community. Please wait.', 'buddypress' ), 983 ), 984 'groups-loop-none' => array( 985 'type' => 'info', 986 'message' => __( 'Sorry, there were no groups found.', 'buddypress' ), 987 ), 988 'group-activity-loading' => array( 989 'type' => 'loading', 990 'message' => __( 'Loading the group updates. Please wait.', 'buddypress' ), 991 ), 992 'group-members-loading' => array( 993 'type' => 'loading', 994 'message' => __( 'Requesting the group members. Please wait.', 'buddypress' ), 995 ), 996 'group-members-none' => array( 997 'type' => 'info', 998 'message' => __( 'Sorry, there were no group members found.', 'buddypress' ), 999 ), 1000 'group-members-search-none' => array( 1001 'type' => 'info', 1002 'message' => __( 'Sorry, there was no member of that name found in this group.', 'buddypress' ), 1003 ), 1004 'group-manage-members-none' => array( 1005 'type' => 'info', 1006 'message' => __( 'This group has no members.', 'buddypress' ), 1007 ), 1008 'group-requests-none' => array( 1009 'type' => 'info', 1010 'message' => __( 'There are no pending membership requests.', 'buddypress' ), 1011 ), 1012 'group-requests-loading' => array( 1013 'type' => 'loading', 1014 'message' => __( 'Loading the members who requested to join the group. Please wait.', 'buddypress' ), 1015 ), 1016 'group-delete-warning' => array( 1017 'type' => 'warning', 1018 'message' => __( 'WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back. Please be careful with this option.', 'buddypress' ), 1019 ), 1020 'group-avatar-delete-info' => array( 1021 'type' => 'info', 1022 'message' => __( 'If you\'d like to remove the existing group profile photo but not upload a new one, please use the delete group profile photo button.', 'buddypress' ), 1023 ), 1024 'directory-members-loading' => array( 1025 'type' => 'loading', 1026 'message' => __( 'Loading the members of your community. Please wait.', 'buddypress' ), 1027 ), 1028 'members-loop-none' => array( 1029 'type' => 'info', 1030 'message' => __( 'Sorry, no members were found.', 'buddypress' ), 1031 ), 1032 'member-requests-none' => array( 1033 'type' => 'info', 1034 'message' => __( 'You have no pending friendship requests.', 'buddypress' ), 1035 ), 1036 'member-invites-none' => array( 1037 'type' => 'info', 1038 'message' => __( 'You have no outstanding group invites.', 'buddypress' ), 1039 ), 1040 'member-notifications-none' => array( 1041 'type' => 'info', 1042 'message' => __( 'This member has no notifications.', 'buddypress' ), 1043 ), 1044 'member-wp-profile-none' => array( 1045 'type' => 'info', 1046 /* translators: %s: member name */ 1047 'message' => __( '%s did not save any profile information yet.', 'buddypress' ), 1048 ), 1049 'member-delete-account' => array( 1050 'type' => 'warning', 1051 'message' => __( 'Deleting this account will delete all of the content it has created. It will be completely unrecoverable.', 'buddypress' ), 1052 ), 1053 'member-activity-loading' => array( 1054 'type' => 'loading', 1055 'message' => __( 'Loading the member\'s updates. Please wait.', 'buddypress' ), 1056 ), 1057 'member-blogs-loading' => array( 1058 'type' => 'loading', 1059 'message' => __( 'Loading the member\'s blogs. Please wait.', 'buddypress' ), 1060 ), 1061 'member-friends-loading' => array( 1062 'type' => 'loading', 1063 'message' => __( 'Loading the member\'s friends. Please wait.', 'buddypress' ), 1064 ), 1065 'member-groups-loading' => array( 1066 'type' => 'loading', 1067 'message' => __( 'Loading the member\'s groups. Please wait.', 'buddypress' ), 1068 ), 1069 'member-notifications-loading' => array( 1070 'type' => 'loading', 1071 'message' => __( 'Loading notifications. Please wait.', 'buddypress' ), 1072 ), 1073 'member-group-invites-all' => array( 1074 'type' => 'info', 1075 'message' => __( 'Currently every member of the community can invite you to join their groups. If you are not comfortable with it, you can always restrict group invites to your friends only.', 'buddypress' ), 1076 ), 1077 'member-group-invites-friends-only' => array( 1078 'type' => 'info', 1079 'message' => __( 'Currently only your friends can invite you to groups. Uncheck the box to allow any member to send invites.', 'buddypress' ), 1080 ), 1081 'member-invites-none' => array( 1082 'type' => 'info', 1083 'message' => __( 'There are no invitations to display.', 'buddypress' ), 1084 ), 1085 ) 1086 ); 1078 1087 1079 1088 if ( ! isset( $feedback_messages[ $feedback_id ] ) ) { 1080 1089 return false; … … function bp_nouveau_get_signup_fields( $section = '' ) { 1217 1226 * Get Some submit buttons data. 1218 1227 * 1219 1228 * @since 3.0.0 1229 * @since 8.0.0 Adds the 'member-send-invite' button. 1220 1230 * 1221 1231 * @param string $action The action requested. 1222 1232 * … … function bp_nouveau_get_submit_button( $action = '' ) { 1232 1242 * Filter the Submit buttons to add your own. 1233 1243 * 1234 1244 * @since 3.0.0 1245 * @since 8.0.0 Adds the 'member-send-invite' button. 1235 1246 * 1236 1247 * @param array $value The list of submit buttons. 1237 1248 * 1238 1249 * @return array|false 1239 1250 */ 1240 $actions = apply_filters( 'bp_nouveau_get_submit_button', array( 1241 'register' => array( 1242 'before' => 'bp_before_registration_submit_buttons', 1243 'after' => 'bp_after_registration_submit_buttons', 1244 'nonce' => 'bp_new_signup', 1245 'attributes' => array( 1246 'name' => 'signup_submit', 1247 'id' => 'submit', 1248 'value' => __( 'Complete Sign Up', 'buddypress' ), 1251 $actions = apply_filters( 1252 'bp_nouveau_get_submit_button', 1253 array( 1254 'register' => array( 1255 'before' => 'bp_before_registration_submit_buttons', 1256 'after' => 'bp_after_registration_submit_buttons', 1257 'nonce' => 'bp_new_signup', 1258 'attributes' => array( 1259 'name' => 'signup_submit', 1260 'id' => 'submit', 1261 'value' => __( 'Complete Sign Up', 'buddypress' ), 1262 ), 1249 1263 ), 1250 ),1251 'member-profile-edit' => array(1252 'before'=> '',1253 'after' => '',1254 'nonce' => 'bp_xprofile_edit',1255 'attributes' => array(1256 'name'=> 'profile-group-edit-submit',1257 'id' => 'profile-group-edit-submit',1258 'value' => __( 'Save Changes', 'buddypress'),1264 'member-profile-edit' => array( 1265 'before' => '', 1266 'after' => '', 1267 'nonce' => 'bp_xprofile_edit', 1268 'attributes' => array( 1269 'name' => 'profile-group-edit-submit', 1270 'id' => 'profile-group-edit-submit', 1271 'value' => __( 'Save Changes', 'buddypress' ), 1272 ), 1259 1273 ), 1260 ),1261 'member-capabilities' => array(1262 'before' => 'bp_members_capabilities_account_before_submit',1263 'after' => 'bp_members_capabilities_account_after_submit',1264 'nonce' => 'capabilities',1265 'attributes' => array(1266 'name'=> 'capabilities-submit',1267 'id' => 'capabilities-submit',1268 'value' => __( 'Save', 'buddypress'),1274 'member-capabilities' => array( 1275 'before' => 'bp_members_capabilities_account_before_submit', 1276 'after' => 'bp_members_capabilities_account_after_submit', 1277 'nonce' => 'capabilities', 1278 'attributes' => array( 1279 'name' => 'capabilities-submit', 1280 'id' => 'capabilities-submit', 1281 'value' => __( 'Save', 'buddypress' ), 1282 ), 1269 1283 ), 1270 ),1271 'member-delete-account' => array(1272 'before' => 'bp_members_delete_account_before_submit',1273 'after' => 'bp_members_delete_account_after_submit',1274 'nonce' => 'delete-account',1275 'attributes' => array(1276 'disabled' => 'disabled',1277 'name'=> 'delete-account-button',1278 'id' => 'delete-account-button',1279 'value' => __( 'Delete Account', 'buddypress'),1284 'member-delete-account' => array( 1285 'before' => 'bp_members_delete_account_before_submit', 1286 'after' => 'bp_members_delete_account_after_submit', 1287 'nonce' => 'delete-account', 1288 'attributes' => array( 1289 'disabled' => 'disabled', 1290 'name' => 'delete-account-button', 1291 'id' => 'delete-account-button', 1292 'value' => __( 'Delete Account', 'buddypress' ), 1293 ), 1280 1294 ), 1281 ),1282 'members-general-settings' => array(1283 'before' => 'bp_core_general_settings_before_submit',1284 'after' => 'bp_core_general_settings_after_submit',1285 'nonce' => 'bp_settings_general',1286 'attributes' => array(1287 'name'=> 'submit',1288 'id' => 'submit',1289 'value' => __( 'Save Changes', 'buddypress' ),1290 'class' => 'auto',1295 'members-general-settings' => array( 1296 'before' => 'bp_core_general_settings_before_submit', 1297 'after' => 'bp_core_general_settings_after_submit', 1298 'nonce' => 'bp_settings_general', 1299 'attributes' => array( 1300 'name' => 'submit', 1301 'id' => 'submit', 1302 'value' => __( 'Save Changes', 'buddypress' ), 1303 'class' => 'auto', 1304 ), 1291 1305 ), 1292 ),1293 'member-notifications-settings' => array(1294 'before' => 'bp_members_notification_settings_before_submit',1295 'after' => 'bp_members_notification_settings_after_submit',1296 'nonce' => 'bp_settings_notifications',1297 'attributes' => array(1298 'name'=> 'submit',1299 'id' => 'submit',1300 'value' => __( 'Save Changes', 'buddypress' ),1301 'class' => 'auto',1306 'member-notifications-settings' => array( 1307 'before' => 'bp_members_notification_settings_before_submit', 1308 'after' => 'bp_members_notification_settings_after_submit', 1309 'nonce' => 'bp_settings_notifications', 1310 'attributes' => array( 1311 'name' => 'submit', 1312 'id' => 'submit', 1313 'value' => __( 'Save Changes', 'buddypress' ), 1314 'class' => 'auto', 1315 ), 1302 1316 ), 1303 ),1304 'members-profile-settings' => array(1305 'before' => 'bp_core_xprofile_settings_before_submit',1306 'after' => 'bp_core_xprofile_settings_after_submit',1307 'nonce' => 'bp_xprofile_settings',1308 'attributes' => array(1309 'name' => 'xprofile-settings-submit',1310 'id' => 'submit',1311 'value' => __( 'Save Changes', 'buddypress' ),1312 'class' => 'auto',1317 'members-profile-settings' => array( 1318 'before' => 'bp_core_xprofile_settings_before_submit', 1319 'after' => 'bp_core_xprofile_settings_after_submit', 1320 'nonce' => 'bp_xprofile_settings', 1321 'attributes' => array( 1322 'name' => 'xprofile-settings-submit', 1323 'id' => 'submit', 1324 'value' => __( 'Save Changes', 'buddypress' ), 1325 'class' => 'auto', 1326 ), 1313 1327 ), 1314 ),1315 'member-group-invites' => array(1316 'nonce' => 'bp_nouveau_group_invites_settings',1317 'attributes' => array(1318 'name' => 'member-group-invites-submit',1319 'id' => 'submit',1320 'value' => __( 'Save', 'buddypress' ),1321 'class' => 'auto',1328 'member-group-invites' => array( 1329 'nonce' => 'bp_nouveau_group_invites_settings', 1330 'attributes' => array( 1331 'name' => 'member-group-invites-submit', 1332 'id' => 'submit', 1333 'value' => __( 'Save', 'buddypress' ), 1334 'class' => 'auto', 1335 ), 1322 1336 ), 1323 ),1324 'activity-new-comment' => array(1325 'after' => 'bp_activity_entry_comments',1326 'nonce' => 'new_activity_comment',1327 'nonce_key' => '_wpnonce_new_activity_comment',1328 'wrapper' => false,1329 'attributes' => array(1330 'name' => 'ac_form_submit',1331 'value' => _x( 'Post', 'button', 'buddypress'),1337 'member-send-invite' => array( 1338 'nonce' => 'bp_network_invitation_send_%d', 1339 'nonce_placeholder_value' => bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id(), 1340 'attributes' => array( 1341 'name' => 'member-send-invite-submit', 1342 'id' => 'submit', 1343 'value' => __( 'Send', 'buddypress' ), 1344 'class' => 'auto', 1345 ), 1332 1346 ), 1333 ), 1334 ) ); 1347 'activity-new-comment' => array( 1348 'after' => 'bp_activity_entry_comments', 1349 'nonce' => 'new_activity_comment', 1350 'nonce_key' => '_wpnonce_new_activity_comment', 1351 'wrapper' => false, 1352 'attributes' => array( 1353 'name' => 'ac_form_submit', 1354 'value' => _x( 'Post', 'button', 'buddypress' ), 1355 ), 1356 ), 1357 ) 1358 ); 1335 1359 1336 1360 if ( isset( $actions[ $action ] ) ) { 1337 1361 return $actions[ $action ]; -
src/bp-templates/bp-nouveau/includes/members/template-tags.php
diff --git src/bp-templates/bp-nouveau/includes/members/template-tags.php src/bp-templates/bp-nouveau/includes/members/template-tags.php index b4fc3ae63..1c9385047 100644
function bp_nouveau_member_template_part() { 660 660 $template = 'profile'; 661 661 } elseif ( bp_is_user_notifications() ) { 662 662 $template = 'notifications'; 663 } elseif ( bp_is_user_members_invitations() ) { 664 $template = 'invitations'; 663 665 } elseif ( bp_is_user_settings() ) { 664 666 $template = 'settings'; 665 667 } -
src/bp-templates/bp-nouveau/includes/template-tags.php
diff --git src/bp-templates/bp-nouveau/includes/template-tags.php src/bp-templates/bp-nouveau/includes/template-tags.php index 3439280fb..c85f63c35 100644
3 3 * Common template tags 4 4 * 5 5 * @since 3.0.0 6 * @version 7.0.06 * @version 8.0.0 7 7 */ 8 8 9 9 // Exit if accessed directly. … … function bp_nouveau_submit_button( $action, $object_id = 0 ) { 2634 2634 printf( '<div class="submit">%s</div>', $submit_input ); 2635 2635 } 2636 2636 2637 $nonce = $submit_data['nonce']; 2638 if ( isset( $submit_data['nonce_placeholder_value'] ) ) { 2639 $nonce = sprintf( $nonce, $submit_data['nonce_placeholder_value'] ); 2640 } 2641 2637 2642 if ( empty( $submit_data['nonce_key'] ) ) { 2638 wp_nonce_field( $ submit_data['nonce']);2643 wp_nonce_field( $nonce ); 2639 2644 } else { 2640 2645 if ( $object_id ) { 2641 2646 $submit_data['nonce_key'] .= '_' . (int) $object_id; 2642 2647 } 2643 2648 2644 wp_nonce_field( $ submit_data['nonce'], $submit_data['nonce_key'] );2649 wp_nonce_field( $nonce, $submit_data['nonce_key'] ); 2645 2650 } 2646 2651 2647 2652 if ( ! empty( $submit_data['after'] ) ) {