Skip to content

Instantly share code, notes, and snippets.

@SirDarcanos
Created October 30, 2023 04:38
Show Gist options
  • Save SirDarcanos/871a0f762b0fd7f6d91d885ba09b6297 to your computer and use it in GitHub Desktop.
Save SirDarcanos/871a0f762b0fd7f6d91d885ba09b6297 to your computer and use it in GitHub Desktop.
Add Email Filter
<?php
// Add the input field
function add_email_filter() {
global $typenow;
if ( 'shop_order' == $typenow ) {
$current_emails = isset( $_GET['filter_emails'] ) ? sanitize_text_field( $_GET['filter_emails'] ) : '';
echo '<input type="text" name="filter_emails" placeholder="Hide orders by email" value="' . esc_attr( $current_emails ) . '">';
}
}
add_action( 'restrict_manage_posts', 'add_email_filter' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment