Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/05/2016 05:15:55 AM (10 years ago)
Author:
boonebgorges
Message:

Move bp-members classes to their own files.

See #6870.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/admin/bp-members-admin-classes.php

    r10456 r10521  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 if ( class_exists( 'WP_Users_List_Table') ) :
    14 
    15 /**
    16  * List table class for signups admin page.
    17  *
    18  * @since 2.0.0
    19  */
    20 class BP_Members_List_Table extends WP_Users_List_Table {
    21 
    22     /**
    23      * Signup counts.
    24      *
    25      * @since 2.0.0
    26      *
    27      * @var int
    28      */
    29     public $signup_counts = 0;
    30 
    31     /**
    32      * Constructor.
    33      *
    34      * @since 2.0.0
    35      */
    36     public function __construct() {
    37         // Define singular and plural labels, as well as whether we support AJAX.
    38         parent::__construct( array(
    39             'ajax'     => false,
    40             'plural'   => 'signups',
    41             'singular' => 'signup',
    42         ) );
    43     }
    44 
    45     /**
    46      * Set up items for display in the list table.
    47      *
    48      * Handles filtering of data, sorting, pagination, and any other data
    49      * manipulation required prior to rendering.
    50      *
    51      * @since 2.0.0
    52      */
    53     public function prepare_items() {
    54         global $usersearch;
    55 
    56         $usersearch       = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
    57         $signups_per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
    58         $paged            = $this->get_pagenum();
    59 
    60         $args = array(
    61             'offset'     => ( $paged - 1 ) * $signups_per_page,
    62             'number'     => $signups_per_page,
    63             'usersearch' => $usersearch,
    64             'orderby'    => 'signup_id',
    65             'order'      => 'DESC'
    66         );
    67 
    68         if ( isset( $_REQUEST['orderby'] ) ) {
    69             $args['orderby'] = $_REQUEST['orderby'];
    70         }
    71 
    72         if ( isset( $_REQUEST['order'] ) ) {
    73             $args['order'] = $_REQUEST['order'];
    74         }
    75 
    76         $signups = BP_Signup::get( $args );
    77 
    78         $this->items = $signups['signups'];
    79         $this->signup_counts = $signups['total'];
    80 
    81         $this->set_pagination_args( array(
    82             'total_items' => $this->signup_counts,
    83             'per_page'    => $signups_per_page,
    84         ) );
    85     }
    86 
    87     /**
    88      * Get the views (the links above the WP List Table).
    89      *
    90      * @since 2.0.0
    91      *
    92      * @uses WP_Users_List_Table::get_views() to get the users views.
    93      */
    94     public function get_views() {
    95         $views = parent::get_views();
    96 
    97         // Remove the 'current' class from the 'All' link.
    98         $views['all']        = str_replace( 'class="current"', '', $views['all'] );
    99         $views['registered'] = sprintf( '<a href="%1$s" class="current">%2$s</a>', esc_url( add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) ), sprintf( _x( 'Pending %s', 'signup users', 'buddypress' ), '<span class="count">(' . number_format_i18n( $this->signup_counts ) . ')</span>' ) );
    100 
    101         return $views;
    102     }
    103 
    104     /**
    105      * Get rid of the extra nav.
    106      *
    107      * WP_Users_List_Table will add an extra nav to change user's role.
    108      * As we're dealing with signups, we don't need this.
    109      *
    110      * @since 2.0.0
    111      *
    112      * @param array $which Current table nav item.
    113      */
    114     public function extra_tablenav( $which ) {
    115         return;
    116     }
    117 
    118     /**
    119      * Specific signups columns.
    120      *
    121      * @since 2.0.0
    122      *
    123      * @return array
    124      */
    125     public function get_columns() {
    126 
    127         /**
    128          * Filters the single site Members signup columns.
    129          *
    130          * @since 2.0.0
    131          *
    132          * @param array $value Array of columns to display.
    133          */
    134         return apply_filters( 'bp_members_signup_columns', array(
    135             'cb'         => '<input type="checkbox" />',
    136             'username'   => __( 'Username',    'buddypress' ),
    137             'name'       => __( 'Name',        'buddypress' ),
    138             'email'      => __( 'Email',       'buddypress' ),
    139             'registered' => __( 'Registered',  'buddypress' ),
    140             'date_sent'  => __( 'Last Sent',   'buddypress' ),
    141             'count_sent' => __( 'Emails Sent', 'buddypress' )
    142         ) );
    143     }
    144 
    145     /**
    146      * Specific bulk actions for signups.
    147      *
    148      * @since 2.0.0
    149      */
    150     public function get_bulk_actions() {
    151         $actions = array(
    152             'activate' => _x( 'Activate', 'Pending signup action', 'buddypress' ),
    153             'resend'   => _x( 'Email',    'Pending signup action', 'buddypress' ),
    154         );
    155 
    156         if ( current_user_can( 'delete_users' ) ) {
    157             $actions['delete'] = __( 'Delete', 'buddypress' );
    158         }
    159 
    160         return $actions;
    161     }
    162 
    163     /**
    164      * The text shown when no items are found.
    165      *
    166      * Nice job, clean sheet!
    167      *
    168      * @since 2.0.0
    169      */
    170     public function no_items() {
    171 
    172         if ( bp_get_signup_allowed() ) {
    173             esc_html_e( 'No pending accounts found.', 'buddypress' );
    174         } else {
    175             $link = false;
    176 
    177             // Specific case when BuddyPress is not network activated.
    178             if ( is_multisite() && current_user_can( 'manage_network_users') ) {
    179                 $link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( network_admin_url( 'settings.php'       ) ), esc_html__( 'Edit settings', 'buddypress' ) );
    180             } elseif ( current_user_can( 'manage_options' ) ) {
    181                 $link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( bp_get_admin_url( 'options-general.php' ) ), esc_html__( 'Edit settings', 'buddypress' ) );
    182             }
    183 
    184             printf( __( 'Registration is disabled. %s', 'buddypress' ), $link );
    185         }
    186 
    187     }
    188 
    189     /**
    190      * The columns signups can be reordered with.
    191      *
    192      * @since 2.0.0
    193      */
    194     public function get_sortable_columns() {
    195         return array(
    196             'username'   => 'login',
    197             'email'      => 'email',
    198             'registered' => 'signup_id',
    199         );
    200     }
    201 
    202     /**
    203      * Display signups rows.
    204      *
    205      * @since 2.0.0
    206      */
    207     public function display_rows() {
    208         $style = '';
    209         foreach ( $this->items as $userid => $signup_object ) {
    210 
    211             // Avoid a notice error appearing since 4.3.0.
    212             if ( isset( $signup_object->id ) ) {
    213                 $signup_object->ID = $signup_object->id;
    214             }
    215 
    216             $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
    217             echo "\n\t" . $this->single_row( $signup_object, $style );
    218         }
    219     }
    220 
    221     /**
    222      * Display a signup row.
    223      *
    224      * @since 2.0.0
    225      *
    226      * @see WP_List_Table::single_row() for explanation of params.
    227      *
    228      * @param object|null $signup_object Signup user object.
    229      * @param string      $style         Styles for the row.
    230      * @param string      $role          Role to be assigned to user.
    231      * @param int         $numposts      Numper of posts.
    232      * @return void
    233      */
    234     public function single_row( $signup_object = null, $style = '', $role = '', $numposts = 0 ) {
    235         echo '<tr' . $style . ' id="signup-' . esc_attr( $signup_object->id ) . '">';
    236         echo $this->single_row_columns( $signup_object );
    237         echo '</tr>';
    238     }
    239 
    240     /**
    241      * Markup for the checkbox used to select items for bulk actions.
    242      *
    243      * @since 2.0.0
    244      *
    245      * @param object|null $signup_object The signup data object.
    246      */
    247     public function column_cb( $signup_object = null ) {
    248     ?>
    249         <label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"><?php printf( esc_html__( 'Select user: %s', 'buddypress' ), $signup_object->user_login ); ?></label>
    250         <input type="checkbox" id="signup_<?php echo intval( $signup_object->id ) ?>" name="allsignups[]" value="<?php echo esc_attr( $signup_object->id ) ?>" />
    251         <?php
    252     }
    253 
    254     /**
    255      * The row actions (delete/activate/email).
    256      *
    257      * @since 2.0.0
    258      *
    259      * @param object|null $signup_object The signup data object.
    260      */
    261     public function column_username( $signup_object = null ) {
    262         $avatar = get_avatar( $signup_object->user_email, 32 );
    263 
    264         // Activation email link.
    265         $email_link = add_query_arg(
    266             array(
    267                 'page'      => 'bp-signups',
    268                 'signup_id' => $signup_object->id,
    269                 'action'    => 'resend',
    270             ),
    271             bp_get_admin_url( 'users.php' )
    272         );
    273 
    274         // Activate link.
    275         $activate_link = add_query_arg(
    276             array(
    277                 'page'      => 'bp-signups',
    278                 'signup_id' => $signup_object->id,
    279                 'action'    => 'activate',
    280             ),
    281             bp_get_admin_url( 'users.php' )
    282         );
    283 
    284         // Delete link.
    285         $delete_link = add_query_arg(
    286             array(
    287                 'page'      => 'bp-signups',
    288                 'signup_id' => $signup_object->id,
    289                 'action'    => 'delete',
    290             ),
    291             bp_get_admin_url( 'users.php' )
    292         );
    293 
    294         echo $avatar . sprintf( '<strong><a href="%1$s" class="edit" title="%2$s">%3$s</a></strong><br/>', esc_url( $activate_link ), esc_attr__( 'Activate', 'buddypress' ), $signup_object->user_login );
    295 
    296         $actions = array();
    297 
    298         $actions['activate'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $activate_link ), __( 'Activate', 'buddypress' ) );
    299         $actions['resend']   = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), __( 'Email', 'buddypress' ) );
    300 
    301         if ( current_user_can( 'delete_users' ) ) {
    302             $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Delete', 'buddypress' ) );
    303         }
    304 
    305         /**
    306          * Filters the multisite row actions for each user in list.
    307          *
    308          * @since 2.0.0
    309          *
    310          * @param array  $actions       Array of actions and corresponding links.
    311          * @param object $signup_object The signup data object.
    312          */
    313         $actions = apply_filters( 'bp_members_ms_signup_row_actions', $actions, $signup_object );
    314 
    315         echo $this->row_actions( $actions );
    316     }
    317 
    318     /**
    319      * Display user name, if any.
    320      *
    321      * @since 2.0.0
    322      *
    323      * @param object $signup_object The signup data object.
    324      */
    325     public function column_name( $signup_object = null ) {
    326         echo esc_html( $signup_object->user_name );
    327     }
    328 
    329     /**
    330      * Display user email.
    331      *
    332      * @since 2.0.0
    333      *
    334      * @param object|null $signup_object The signup data object.
    335      */
    336     public function column_email( $signup_object = null ) {
    337         printf( '<a href="mailto:%1$s">%2$s</a>', esc_attr( $signup_object->user_email ), esc_html( $signup_object->user_email ) );
    338     }
    339 
    340     /**
    341      * Display registration date.
    342      *
    343      * @since 2.0.0
    344      *
    345      * @param object|null $signup_object The signup data object.
    346      */
    347     public function column_registered( $signup_object = null ) {
    348         echo mysql2date( 'Y/m/d', $signup_object->registered );
    349     }
    350 
    351     /**
    352      * Display the last time an activation email has been sent.
    353      *
    354      * @since 2.0.0
    355      *
    356      * @param object|null $signup_object The signup data object.
    357      */
    358     public function column_date_sent( $signup_object = null ) {
    359         echo mysql2date( 'Y/m/d', $signup_object->date_sent );
    360     }
    361 
    362     /**
    363      * Display number of time an activation email has been sent.
    364      *
    365      * @since 2.0.0
    366      *
    367      * @param object|null $signup_object Signup object instance.
    368      */
    369     public function column_count_sent( $signup_object = null ) {
    370         echo absint( $signup_object->count_sent );
    371     }
    372 
    373     /**
    374      * Allow plugins to add their custom column.
    375      *
    376      * @since 2.1.0
    377      *
    378      * @param object|null $signup_object The signup data object.
    379      * @param string      $column_name   The column name.
    380      * @return string
    381      */
    382     function column_default( $signup_object = null, $column_name = '' ) {
    383 
    384         /**
    385          * Filters the single site custom columns for plugins.
    386          *
    387          * @since 2.1.0
    388          *
    389          * @param string $column_name   The column name.
    390          * @param object $signup_object The signup data object.
    391          */
    392         return apply_filters( 'bp_members_signup_custom_column', '', $column_name, $signup_object );
    393     }
     13if ( class_exists( 'WP_Users_List_Table' ) ) {
     14    require dirname( dirname( __FILE__ ) ) . '/classes/class-bp-members-list-table.php';
    39415}
    39516
    396 endif;
    397 
    398 if ( class_exists( 'WP_MS_Users_List_Table' ) ) :
    399 
    400 /**
    401  * List table class for signups network admin page.
    402  *
    403  * @since 2.0.0
    404  */
    405 class BP_Members_MS_List_Table extends WP_MS_Users_List_Table {
    406 
    407     /**
    408      * Signup counts.
    409      *
    410      * @since 2.0.0
    411      *
    412      * @var int
    413      */
    414     public $signup_counts = 0;
    415 
    416     /**
    417      * Constructor.
    418      *
    419      * @since 2.0.0
    420      */
    421     public function __construct() {
    422         // Define singular and plural labels, as well as whether we support AJAX.
    423         parent::__construct( array(
    424             'ajax'     => false,
    425             'plural'   => 'signups',
    426             'singular' => 'signup',
    427         ) );
    428     }
    429 
    430     /**
    431      * Set up items for display in the list table.
    432      *
    433      * Handles filtering of data, sorting, pagination, and any other data
    434      * manipulation required prior to rendering.
    435      *
    436      * @since 2.0.0
    437      */
    438     public function prepare_items() {
    439         global $usersearch, $mode;
    440 
    441         $usersearch       = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
    442         $signups_per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
    443         $paged            = $this->get_pagenum();
    444 
    445         $args = array(
    446             'offset'     => ( $paged - 1 ) * $signups_per_page,
    447             'number'     => $signups_per_page,
    448             'usersearch' => $usersearch,
    449             'orderby'    => 'signup_id',
    450             'order'      => 'DESC'
    451         );
    452 
    453         if ( isset( $_REQUEST['orderby'] ) ) {
    454             $args['orderby'] = $_REQUEST['orderby'];
    455         }
    456 
    457         if ( isset( $_REQUEST['order'] ) ) {
    458             $args['order'] = $_REQUEST['order'];
    459         }
    460 
    461         $mode    = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
    462         $signups = BP_Signup::get( $args );
    463 
    464         $this->items         = $signups['signups'];
    465         $this->signup_counts = $signups['total'];
    466 
    467         $this->set_pagination_args( array(
    468             'total_items' => $this->signup_counts,
    469             'per_page'    => $signups_per_page,
    470         ) );
    471     }
    472 
    473     /**
    474      * Get the views : the links above the WP List Table.
    475      *
    476      * @since 2.0.0
    477      *
    478      * @uses WP_MS_Users_List_Table::get_views() to get the users views.
    479      */
    480     public function get_views() {
    481         $views = parent::get_views();
    482 
    483         // Remove the 'current' class from the 'All' link.
    484         $views['all']        = str_replace( 'class="current"', '', $views['all'] );
    485         $views['registered'] = sprintf( '<a href="%1$s" class="current">%2$s</a>', esc_url( add_query_arg( 'page', 'bp-signups', network_admin_url( 'users.php' ) ) ), sprintf( _x( 'Pending %s', 'signup users', 'buddypress' ), '<span class="count">(' . number_format_i18n( $this->signup_counts ) . ')</span>' ) );
    486 
    487         return $views;
    488     }
    489 
    490     /**
    491      * Specific signups columns.
    492      *
    493      * @since 2.0.0
    494      *
    495      * @return array
    496      */
    497     public function get_columns() {
    498 
    499         /**
    500          * Filters the multisite Members signup columns.
    501          *
    502          * @since 2.0.0
    503          *
    504          * @param array $value Array of columns to display.
    505          */
    506         return apply_filters( 'bp_members_ms_signup_columns', array(
    507             'cb'         => '<input type="checkbox" />',
    508             'username'   => __( 'Username',    'buddypress' ),
    509             'name'       => __( 'Name',        'buddypress' ),
    510             'email'      => __( 'Email',       'buddypress' ),
    511             'registered' => __( 'Registered',  'buddypress' ),
    512             'date_sent'  => __( 'Last Sent',   'buddypress' ),
    513             'count_sent' => __( 'Emails Sent', 'buddypress' )
    514         ) );
    515     }
    516 
    517     /**
    518      * Specific bulk actions for signups.
    519      *
    520      * @since 2.0.0
    521      */
    522     public function get_bulk_actions() {
    523         $actions = array(
    524             'activate' => _x( 'Activate', 'Pending signup action', 'buddypress' ),
    525             'resend'   => _x( 'Email',    'Pending signup action', 'buddypress' ),
    526         );
    527 
    528         if ( current_user_can( 'delete_users' ) ) {
    529             $actions['delete'] = __( 'Delete', 'buddypress' );
    530         }
    531 
    532         return $actions;
    533     }
    534 
    535     /**
    536      * The text shown when no items are found.
    537      *
    538      * Nice job, clean sheet!
    539      *
    540      * @since 2.0.0
    541      */
    542     public function no_items() {
    543         if ( bp_get_signup_allowed() ) {
    544             esc_html_e( 'No pending accounts found.', 'buddypress' );
    545         } else {
    546             $link = false;
    547 
    548             if ( current_user_can( 'manage_network_users' ) ) {
    549                 $link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( network_admin_url( 'settings.php' ) ), esc_html__( 'Edit settings', 'buddypress' ) );
    550             }
    551 
    552             printf( __( 'Registration is disabled. %s', 'buddypress' ), $link );
    553         }
    554     }
    555 
    556     /**
    557      * The columns signups can be reordered with.
    558      *
    559      * @since 2.0.0
    560      */
    561     public function get_sortable_columns() {
    562         return array(
    563             'username'   => 'login',
    564             'email'      => 'email',
    565             'registered' => 'signup_id',
    566         );
    567     }
    568 
    569     /**
    570      * Display signups rows.
    571      *
    572      * @since 2.0.0
    573      */
    574     public function display_rows() {
    575         $style = '';
    576         foreach ( $this->items as $userid => $signup_object ) {
    577 
    578             // Avoid a notice error appearing since 4.3.0.
    579             if ( isset( $signup_object->id ) ) {
    580                 $signup_object->ID = $signup_object->id;
    581             }
    582 
    583             $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
    584             echo "\n\t" . $this->single_row( $signup_object, $style );
    585         }
    586     }
    587 
    588     /**
    589      * Display a signup row.
    590      *
    591      * @since 2.0.0
    592      *
    593      * @see WP_List_Table::single_row() for explanation of params.
    594      *
    595      * @param object|null $signup_object Signup user object.
    596      * @param string      $style         Styles for the row.
    597      */
    598     public function single_row( $signup_object = null, $style = '' ) {
    599         echo '<tr' . $style . ' id="signup-' . esc_attr( $signup_object->id ) . '">';
    600         echo $this->single_row_columns( $signup_object );
    601         echo '</tr>';
    602     }
    603 
    604     /**
    605      * Prevents regular users row actions to be output.
    606      *
    607      * @since 2.4.0
    608      *
    609      * @param object|null $signup_object Signup being acted upon.
    610      * @param string      $column_name   Current column name.
    611      * @param string      $primary       Primary column name.
    612      * @return string
    613      */
    614     protected function handle_row_actions( $signup_object = null, $column_name = '', $primary = '' ) {
    615         return '';
    616     }
    617 
    618     /**
    619      * Markup for the checkbox used to select items for bulk actions.
    620      *
    621      * @since 2.0.0
    622      *
    623      * @param object|null $signup_object The signup data object.
    624      */
    625     public function column_cb( $signup_object = null ) {
    626     ?>
    627         <label class="screen-reader-text" for="signup_<?php echo intval( $signup_object->id ); ?>"><?php printf( esc_html__( 'Select user: %s', 'buddypress' ), $signup_object->user_login ); ?></label>
    628         <input type="checkbox" id="signup_<?php echo intval( $signup_object->id ) ?>" name="allsignups[]" value="<?php echo esc_attr( $signup_object->id ) ?>" />
    629         <?php
    630     }
    631 
    632     /**
    633      * The row actions (delete/activate/email).
    634      *
    635      * @since 2.0.0
    636      *
    637      * @param object|null $signup_object The signup data object.
    638      */
    639     public function column_username( $signup_object = null ) {
    640         $avatar = get_avatar( $signup_object->user_email, 32 );
    641 
    642         // Activation email link.
    643         $email_link = add_query_arg(
    644             array(
    645                 'page'      => 'bp-signups',
    646                 'signup_id' => $signup_object->id,
    647                 'action'    => 'resend',
    648             ),
    649             network_admin_url( 'users.php' )
    650         );
    651 
    652         // Activate link.
    653         $activate_link = add_query_arg(
    654             array(
    655                 'page'      => 'bp-signups',
    656                 'signup_id' => $signup_object->id,
    657                 'action'    => 'activate',
    658             ),
    659             network_admin_url( 'users.php' )
    660         );
    661 
    662         // Delete link.
    663         $delete_link = add_query_arg(
    664             array(
    665                 'page'      => 'bp-signups',
    666                 'signup_id' => $signup_object->id,
    667                 'action'    => 'delete',
    668             ),
    669             network_admin_url( 'users.php' )
    670         );
    671 
    672         echo $avatar . sprintf( '<strong><a href="%1$s" class="edit" title="%2$s">%3$s</a></strong><br/>', esc_url( $activate_link ), esc_attr__( 'Activate', 'buddypress' ), $signup_object->user_login );
    673 
    674         $actions = array();
    675 
    676         $actions['activate'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $activate_link ), __( 'Activate', 'buddypress' ) );
    677         $actions['resend']   = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link    ), __( 'Email',    'buddypress' ) );
    678 
    679         if ( current_user_can( 'delete_users' ) ) {
    680             $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Delete', 'buddypress' ) );
    681         }
    682 
    683         /** This filter is documented in bp-members/admin/bp-members-classes.php */
    684         $actions = apply_filters( 'bp_members_ms_signup_row_actions', $actions, $signup_object );
    685 
    686         echo $this->row_actions( $actions );
    687     }
    688 
    689     /**
    690      * Display user name, if any.
    691      *
    692      * @since 2.0.0
    693      *
    694      * @param object|null $signup_object The signup data object.
    695      */
    696     public function column_name( $signup_object = null ) {
    697         echo esc_html( $signup_object->user_name );
    698     }
    699 
    700     /**
    701      * Display user email.
    702      *
    703      * @since 2.0.0
    704      *
    705      * @param object|null $signup_object The signup data object.
    706      */
    707     public function column_email( $signup_object = null ) {
    708         printf( '<a href="mailto:%1$s">%2$s</a>', esc_attr( $signup_object->user_email ), esc_html( $signup_object->user_email ) );
    709     }
    710 
    711     /**
    712      * Display registration date.
    713      *
    714      * @since 2.0.0
    715      *
    716      * @param object|null $signup_object The signup data object.
    717      */
    718     public function column_registered( $signup_object = null ) {
    719         global $mode;
    720 
    721         if ( 'list' === $mode ) {
    722             $date = 'Y/m/d';
    723         } else {
    724             $date = 'Y/m/d \<\b\r \/\> g:i:s a';
    725         }
    726 
    727         echo mysql2date( $date, $signup_object->registered ) . "</td>";
    728     }
    729 
    730     /**
    731      * Display the last time an activation email has been sent.
    732      *
    733      * @since 2.0.0
    734      *
    735      * @param object|null $signup_object Signup object instance.
    736      */
    737     public function column_date_sent( $signup_object = null ) {
    738         global $mode;
    739 
    740         if ( 'list' === $mode ) {
    741             $date = 'Y/m/d';
    742         } else {
    743             $date = 'Y/m/d \<\b\r \/\> g:i:s a';
    744         }
    745 
    746         echo mysql2date( $date, $signup_object->date_sent );
    747     }
    748 
    749     /**
    750      * Display number of time an activation email has been sent.
    751      *
    752      * @since 2.0.0
    753      *
    754      * @param object|null $signup_object Signup object instance.
    755      */
    756     public function column_count_sent( $signup_object = null ) {
    757         echo absint( $signup_object->count_sent );
    758     }
    759 
    760     /**
    761      * Allow plugins to add their custom column.
    762      *
    763      * @since 2.1.0
    764      *
    765      * @param object|null $signup_object The signup data object.
    766      * @param string      $column_name   The column name.
    767      * @return string
    768      */
    769     function column_default( $signup_object = null, $column_name = '' ) {
    770 
    771         /**
    772          * Filters the multisite custom columns for plugins.
    773          *
    774          * @since 2.1.0
    775          *
    776          * @param string $column_name   The column name.
    777          * @param object $signup_object The signup data object.
    778          */
    779         return apply_filters( 'bp_members_ms_signup_custom_column', '', $column_name, $signup_object );
    780     }
     17if ( class_exists( 'WP_MS_Users_List_Table' ) ) {
     18    require dirname( dirname( __FILE__ ) ) . '/classes/class-bp-members-ms-list-table.php';
    78119}
    782 
    783 endif;
Note: See TracChangeset for help on using the changeset viewer.