Skip to content

Commit

Permalink
fix(event-log): only show users filter with environment constant (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoo authored Mar 29, 2024
1 parent ce82bb0 commit cd4a91a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions includes/hub/admin/class-event-log-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* The Event Log List Table
*/
class Event_Log_List_Table extends \WP_List_Table {


/**
* Get the table columns
*
Expand Down Expand Up @@ -56,14 +56,14 @@ public function prepare_items() {
$args['action_name'] = sanitize_text_field( $_GET['action_name'] );
}

if ( isset( $_GET['node_id'] ) ) {
if ( isset( $_GET['node_id'] ) ) {
$args['node_id'] = sanitize_text_field( $_GET['node_id'] );
}

if ( isset( $_GET['email'] ) ) {
if ( isset( $_GET['email'] ) ) {
$args['email'] = sanitize_text_field( $_GET['email'] );
}

$columns = $this->get_columns();
$primary = 'id';
$this->_column_headers = array( $columns, [], [], $primary );
Expand Down Expand Up @@ -106,12 +106,14 @@ protected function extra_tablenav( $which ) {
<?php endforeach; ?>
</select>

<?php if ( defined( 'NEWSPACK_NETWORK_EVENT_LOG_SHOW_USERS_FILTER' ) && NEWSPACK_NETWORK_EVENT_LOG_SHOW_USERS_FILTER ) : ?>
<select name="email" id="email">
<option value=""><?php _e( 'All users', 'newspack-network' ); ?></option>
<?php foreach ( $all_emails as $email ) : ?>
<option value="<?php echo esc_attr( $email ); ?>" <?php selected( $current_email, $email ); ?>><?php echo esc_html( $email ); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>

<?php Nodes::nodes_dropdown( $current_node ); ?>

Expand Down

0 comments on commit cd4a91a

Please sign in to comment.