[buddypress-trac] [BuddyPress Trac] #8304: Add `Delete Permanently` link to activity edit page

buddypress-trac noreply at wordpress.org
Sun May 24 05:45:03 UTC 2020


#8304: Add `Delete Permanently` link to activity edit page
----------------------------+----------------------
 Reporter:  oztaser         |       Owner:  slaFFik
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  7.0.0
Component:  Administration  |     Version:  1.6
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+----------------------

Comment (by imath):

 I've tested the patch and you're almost done. Great work!

 1) Could you include
 [https://buddypress.trac.wordpress.org/attachment/ticket/8304/8304-2b.patch
 8304-2b.patch] to your patch: it removes the `javascript:confirm` from the
 delete action of the Activity WP List Table that is no more necessary.

 2) Instead of the content or the activity action, I think it would be
 better to use something like this for the bullet points of the
 confirmation page:
 "Action/type" activity submitted by username on date with a link to the
 activity on the date. Eg:

 - "New post published" activity submitted by
 [https://buddypress.org/members/imath/ imath] on
 [https://buddypress.org/members/imath/activity/33451/ may 24, 2020]

 3) finally, here are some minor improvements
 {{{
 // Add a space between ! and empty.
 +       if ( ! empty( $doaction ) && ! in_array( $doaction, array( '-1',
 'edit', 'save', 'delete', 'bulk_delete' ) ) ) {

 // Use === instead of ==.
 +       if ( 'edit' === $doaction && ! empty( $_GET['aid'] ) ) {
                 bp_activity_admin_edit();
 +       }

 // Add a full stop at the end of the comment.
 +       // This is a request to delete single or multiple item.

 // Use esc_html_e() instead of _e().
 +               <h1><?php esc_html_e( 'Delete Activities', 'buddypress' )
 ?></h1>
 +               <p><?php esc_html_e( 'You are about to delete the
 following activities:', 'buddypress' ) ?></p>

 +               <p><strong><?php esc_html_e( 'This action cannot be
 undone.', 'buddypress' ) ?></strong></p>

 +               <a class="button" href="<?php echo esc_attr( $base_url );
 ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a>

 +                               <a class="submitdelete deletion"
 href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'action', 'delete',
 $base_url ), 'bp-activities-delete' ) ); ?>"><?php esc_html_e( 'Delete
 Permanently', 'buddypress' ) ?></a>
 }}}

 Thanks again for your great work 👍

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8304#comment:5>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list