Changeset 3170781
- Timestamp:
- 10/17/2024 02:30:16 PM (18 months ago)
- Location:
- rsvp-manager/trunk
- Files:
-
- 5 edited
-
README.md (modified) (2 diffs)
-
admin/actions/manage-attendee.php (modified) (2 diffs)
-
admin/pages/info.php (modified) (1 diff)
-
css/related-attendees-styles.css (modified) (1 diff)
-
database/handlers/related_attendees_handler.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rsvp-manager/trunk/README.md
r3164704 r3170781 5 5 Requires at least: 4.7.19 6 6 Tested up to: 6.6.1 7 Stable tag: 1. 07 Stable tag: 1.1 8 8 Requires PHP: 7.4.19 9 9 License: GPLv3 … … 86 86 == Changelog == 87 87 88 = 1.0 = 88 = 1.1 - 17.10.2024 = 89 90 #### New Features 91 - **Reciprocal Attendee Associations**: 92 - Added a new option to enable reciprocal (mutual) associations between attendees. When attendee X is associated with attendee Y, Y is automatically associated with X. 93 - Introduced the "Reciprocal Association" checkbox in the attendee creation/edit screen to control this behavior. 94 95 = 1.0 - 07.10.2024 = 89 96 * Initial release of the plugin with core functionality for managing RSVPs for a private event. -
rsvp-manager/trunk/admin/actions/manage-attendee.php
r3164462 r3170781 48 48 49 49 // update the related attendees if there were changes 50 $is_mutual_association = isset($_POST['mutual_association']); 50 51 $related_attendee_ids = isset($_POST['related_attendee_ids']) ? sanitize_text_field(wp_unslash($_POST['related_attendee_ids'])) : null; 51 52 if ($related_attendee_ids !== null) { … … 54 55 $ids = array_map('intval', $related_attendees_array); 55 56 if ($ids !== null) { 56 RelatedAttendeesHandler::get_instance()->save_related_attendees($attendee_id, $ids );57 RelatedAttendeesHandler::get_instance()->save_related_attendees($attendee_id, $ids, $is_mutual_association); 57 58 } 58 59 } -
rsvp-manager/trunk/admin/pages/info.php
r3164462 r3170781 30 30 31 31 <h2>Version</h2> 32 <p>Current Version: 1. 0</p>32 <p>Current Version: 1.1</p> 33 33 </div> 34 34 <?php -
rsvp-manager/trunk/css/related-attendees-styles.css
r3164462 r3170781 44 44 background-color: #cfcfcf; 45 45 } 46 47 .mutual_association_container { 48 margin-top: 15px; 49 } -
rsvp-manager/trunk/database/handlers/related_attendees_handler.php
r3164462 r3170781 28 28 } 29 29 30 function save_related_attendees($main_attendee_id, $related_attendee_ids ) {30 function save_related_attendees($main_attendee_id, $related_attendee_ids, $is_mutual_association) { 31 31 // First we remove the already related attendees for the main attendee. 32 32 $this->delete_related_attendees($main_attendee_id); … … 43 43 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- The query is already safely prepared. No chaching is used for now. 44 44 $wpdb->query($query); 45 } 46 47 if ($is_mutual_association) { 48 $this->save_mutual_associations($main_attendee_id, $related_attendee_ids); 49 } 50 } 51 52 /** 53 * For the related attendees of the main attendee, saves the main attendee as related attendee. 54 */ 55 private function save_mutual_associations($main_attendee_id, $related_attendee_ids) { 56 global $wpdb; 57 $table_name = RelatedAttendeesTable::TABLE_NAME; 58 foreach ($related_attendee_ids as $related_attendee_id) { 59 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery -- Caching is not used. We have a custom db table here so we have to use a direct query. 60 $wpdb->query($wpdb->prepare( 61 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- The query is already safely prepared. 62 "INSERT IGNORE INTO {$table_name} (main_attendee_id, related_attendee_id) VALUES (%d, %d)", 63 $related_attendee_id, 64 $main_attendee_id 65 )); 45 66 } 46 67 }
Note: See TracChangeset
for help on using the changeset viewer.