Created
October 30, 2023 04:38
-
-
Save SirDarcanos/871a0f762b0fd7f6d91d885ba09b6297 to your computer and use it in GitHub Desktop.
Add Email Filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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