Skip to:
Content

BuddyPress.org

Ticket #7533: 7533.diff

File 7533.diff, 3.9 KB (added by espellcaste, 5 years ago)
  • src/bp-activity/classes/class-bp-activity-list-table.php

    diff --git src/bp-activity/classes/class-bp-activity-list-table.php src/bp-activity/classes/class-bp-activity-list-table.php
    index c581905e7..e7d023969 100644
    class BP_Activity_List_Table extends WP_List_Table { 
    338338         *
    339339         * @return array Key/value pairs for the bulk actions dropdown.
    340340         */
    341         function get_bulk_actions() {
    342                 $actions = array();
    343                 $actions['bulk_spam']   = __( 'Mark as Spam', 'buddypress' );
    344                 $actions['bulk_ham']    = __( 'Not Spam', 'buddypress' );
    345                 $actions['bulk_delete'] = __( 'Delete Permanently', 'buddypress' );
     341        public function get_bulk_actions() {
    346342
    347343                /**
    348344                 * Filters the default bulk actions so plugins can add custom actions.
    class BP_Activity_List_Table extends WP_List_Table { 
    351347                 *
    352348                 * @param array $actions Default available actions for bulk operations.
    353349                 */
    354                 return apply_filters( 'bp_activity_list_table_get_bulk_actions', $actions );
     350                return apply_filters( 'bp_activity_list_table_get_bulk_actions', array(
     351                        'bulk_spam'   => __( 'Mark as Spam', 'buddypress' ),
     352                        'bulk_ham'    => __( 'Not Spam', 'buddypress' ),
     353                        'bulk_delete' => __( 'Delete Permanently', 'buddypress' ),
     354                ) );
    355355        }
    356356
    357357        /**
    class BP_Activity_List_Table extends WP_List_Table { 
    364364         * @return array The columns to appear in the Activity list table.
    365365         */
    366366        function get_columns() {
     367
    367368                /**
    368369                 * Filters the titles for the columns for the activity list table.
    369370                 *
    class BP_Activity_List_Table extends WP_List_Table { 
    373374                 */
    374375                return apply_filters( 'bp_activity_list_table_get_columns', array(
    375376                        'cb'       => '<input name type="checkbox" />',
    376                         'author'   => _x('Author', 'Admin SWA column header', 'buddypress' ),
     377                        'author'   => _x( 'Author', 'Admin SWA column header', 'buddypress' ),
    377378                        'comment'  => _x( 'Activity', 'Admin SWA column header', 'buddypress' ),
    378379                        'action'   => _x( 'Action', 'Admin SWA column header', 'buddypress' ),
    379380                        'response' => _x( 'In Response To', 'Admin SWA column header', 'buddypress' ),
    class BP_Activity_List_Table extends WP_List_Table { 
    383384        /**
    384385         * Get the column names for sortable columns.
    385386         *
    386          * Currently, returns an empty array (no columns are sortable).
    387          *
    388387         * @since 1.6.0
    389          * @todo For this to work, BP_Activity_Activity::get() needs updating
    390          *       to support ordering by specific fields.
    391388         *
    392389         * @return array The columns that can be sorted on the Activity screen.
    393390         */
    394         function get_sortable_columns() {
    395                 return array();
     391        public function get_sortable_columns() {
    396392
    397                 /*return array(
    398                         'author' => array( 'activity_author', false ),  // Intentionally not using "=>"
    399                 );*/
     393                /**
     394                 * Filters the column names for the sortable columns.
     395                 *
     396                 * @since 5.0.0
     397                 *
     398                 * @param array $value Array of column names.
     399                 */
     400                return apply_filters( 'bp_activity_list_table_get_sortable_columns', array() );
    400401        }
    401402
    402403        /**
  • src/bp-groups/classes/class-bp-groups-list-table.php

    diff --git src/bp-groups/classes/class-bp-groups-list-table.php src/bp-groups/classes/class-bp-groups-list-table.php
    index f831e0d60..039d913ad 100644
    class BP_Groups_List_Table extends WP_List_Table { 
    417417         * @return array Array of sortable column names.
    418418         */
    419419        public function get_sortable_columns() {
    420                 return array(
     420
     421                /**
     422                 * Filters the column names for the sortable columns.
     423                 *
     424                 * @since 5.0.0
     425                 *
     426                 * @param array $value Array of keys and their values.
     427                 */
     428                return apply_filters( 'bp_groups_list_table_get_sortable_columns', array(
    421429                        'gid'         => array( 'gid', false ),
    422430                        'comment'     => array( 'name', false ),
    423431                        'members'     => array( 'members', false ),
    424432                        'last_active' => array( 'last_active', false ),
    425                 );
     433                ) );
    426434        }
    427435
    428436        /**