Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/10/2021 04:14:51 PM (4 years ago)
Author:
dcavins
Message:

Manage Signups Screen: Change labels and behavior for requests.

Change many labels in the WP Admin Signups Screen
to reflect the membership requests capability when enabled.

Add new "Profile Info" action link to User List Tables
so that the site admin can see submitted extended profile
info and any blog requests.

See #8582.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/classes/class-bp-members-list-table.php

    r12591 r13169  
    2828
    2929    /**
     30     * Signup profile fields.
     31     *
     32     * @since 10.0.0
     33     *
     34     * @var array
     35     */
     36    public $signup_field_labels = array();
     37
     38    /**
    3039     * Constructor.
    3140     *
     
    139148    public function get_columns() {
    140149
    141         /**
    142          * Filters the single site Members signup columns.
    143          *
    144          * @since 2.0.0
    145          *
    146          * @param array $value Array of columns to display.
    147          */
    148         return apply_filters( 'bp_members_signup_columns', array(
     150        $columns = array(
    149151            'cb'         => '<input type="checkbox" />',
    150152            'username'   => __( 'Username',    'buddypress' ),
     
    154156            'date_sent'  => __( 'Last Sent',   'buddypress' ),
    155157            'count_sent' => __( 'Emails Sent', 'buddypress' )
    156         ) );
     158        );
     159
     160        /**
     161         * Filters the single site Members signup columns.
     162         *
     163         * @since 2.0.0
     164         *
     165         * @param array $value Array of columns to display.
     166         */
     167        return apply_filters( 'bp_members_signup_columns', $columns );
    157168    }
    158169
     
    172183        }
    173184
    174         return $actions;
     185        /**
     186         * Filters the bulk actions for signups.
     187         *
     188         * @since 10.0.0
     189         *
     190         * @param array $actions Array of actions and corresponding labels.
     191         */
     192        return apply_filters( 'bp_members_ms_signup_bulk_actions', $actions );
    175193    }
    176194
     
    184202    public function no_items() {
    185203
    186         if ( bp_get_signup_allowed() ) {
     204        if ( bp_get_signup_allowed() || bp_get_membership_requests_required() ) {
    187205            esc_html_e( 'No pending accounts found.', 'buddypress' );
    188206        } else {
     
    343361    public function column_name( $signup_object = null ) {
    344362        echo esc_html( $signup_object->user_name );
     363
     364        // Insert the extended profile modal content required by thickbox.
     365        if ( ! bp_is_active( 'xprofile' ) ) {
     366            return;
     367        }
     368
     369        $profile_field_ids = array();
     370
     371        // Fetch registration field data once only.
     372        if ( ! $this->signup_field_labels ) {
     373            $field_groups = bp_xprofile_get_groups(
     374                array(
     375                    'fetch_fields'       => true,
     376                    'signup_fields_only' => true,
     377                )
     378            );
     379
     380            foreach ( $field_groups as $field_group ) {
     381                foreach ( $field_group->fields as $field ) {
     382                    $this->signup_field_labels[ $field->id ] = $field->name;
     383                }
     384            }
     385        }
     386
     387        bp_members_admin_preview_signup_profile_info( $this->signup_field_labels, $signup_object );
    345388    }
    346389
     
    364407     */
    365408    public function column_registered( $signup_object = null ) {
    366         echo mysql2date( 'Y/m/d', $signup_object->registered );
     409        echo mysql2date( 'Y/m/d g:i:s a', $signup_object->registered );
    367410    }
    368411
     
    375418     */
    376419    public function column_date_sent( $signup_object = null ) {
    377         echo mysql2date( 'Y/m/d', $signup_object->date_sent );
    378     }
    379 
    380     /**
    381      * Display number of time an activation email has been sent.
     420        if ( $signup_object->count_sent > 0 ) {
     421            echo mysql2date( 'Y/m/d g:i:s a', $signup_object->date_sent );
     422        } else {
     423            $message = __( 'Not yet notified', 'buddypress' );
     424
     425            /**
     426             * Filters the "not yet sent" message for "Last Sent"
     427             * column in Manage Signups list table.
     428             *
     429             * @since 10.0.0
     430             *
     431             * @param string      $message       "Not yet sent" message.
     432             * @param object|null $signup_object Signup object instance.
     433             */
     434            $message = apply_filters( 'bp_members_signup_date_sent_unsent_message', $message, $signup_object );
     435
     436            echo esc_html( $message );
     437        }
     438    }
     439
     440    /**
     441     * Display number of times an activation email has been sent.
    382442     *
    383443     * @since 2.0.0
Note: See TracChangeset for help on using the changeset viewer.