Title: PHP Warning: Undefined array key &#8220;filter-by-payment&#8221;
Last modified: January 19, 2023

---

# PHP Warning: Undefined array key “filter-by-payment”

 *  Resolved [inspired888](https://wordpress.org/support/users/inspired888/)
 * (@inspired888)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-filter-by-payment/)
 * Hi there. Thanks for this handy plug-in. I’m seeing a warning occurring (a lot)
   in our error logs. As follows:
 *     ```wp-block-code
       AH01071: Got error 'PHP message: PHP Warning: Undefined array key "filter-by-payment" in ***/public_html/wp-content/plugins/payment-method-order-column/era-pmoc.php on line 161'
       ```
   
 * Is this something you can fix in a new release please?
 * I realise it PHP warnings typically don’t prevent the code from working, but 
   ideally it was be coded in such a way that warnings such as this don’t occur.
   It makes for large error log files.
 * Thank you,
 * Jonathan

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [alessio.rosi](https://wordpress.org/support/users/alessiorosi/)
 * (@alessiorosi)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-filter-by-payment/#post-16399184)
 * Thank you Jonathan, for your feedback!
   We will check this out and fix as soon
   as possible. It’s just a warning but we will fix it especially for next PHP releases
 *  Thread Starter [inspired888](https://wordpress.org/support/users/inspired888/)
 * (@inspired888)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-filter-by-payment/#post-16542260)
 * Thanks Alessio. Much appreciated.
   Indeed … it’s just a warning. Although I find
   that most server configs hare logging of PHP warnings on by default, and this**`
   filter-by-payment` **warning creates a lot of noice/bloat in the logs. So would
   be great to see it gone. As far as I can tell, it’s just a matter of doing a 
   test on the `$filter_id` (e.g. `if ( isset( $_GET[ $filter_id ] ) ) {`. Seems
   to do the trick.In the mean time, I’ve written a new plug-in which achieves the
   same result, but with some changes to the Payment Method column. I prefer to 
   see up front the card number, so I’ve written it to display “Amex 5647” (for 
   example), rather than an icon and then having to hover over; also, it displays
   an svg Apple icon after those cards processed through Apple Pay, and an svg Google
   icon for those done on Google Pay). Just some minor adjustments I figured I might
   as well do along the way.Wishing all the best …
 *  Plugin Author [alessio.rosi](https://wordpress.org/support/users/alessiorosi/)
 * (@alessiorosi)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-filter-by-payment/#post-17023656)
 * The issue is fixed by adding :
 *     ```wp-block-code
           $payment_filter= isset($_GET[$filter_id]) ? sanitize_text_field($_GET[$filter_id]) : '';
       ```
   
 * In the column is possible to display everything inside the payment method (the
   simple icon, the cart number, the pay pal transaction id ….)
 * Could be nice to set some admin configuration for the plugin to set what to display
   in the column

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP Warning: Undefined array key “filter-by-payment”’ is closed to new
replies.

 * ![](https://ps.w.org/payment-method-order-column/assets/icon.svg?rev=2812637)
 * [Payment Method Order Column](https://wordpress.org/plugins/payment-method-order-column/)
 * [Support Threads](https://wordpress.org/support/plugin/payment-method-order-column/)
 * [Active Topics](https://wordpress.org/support/plugin/payment-method-order-column/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/payment-method-order-column/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/payment-method-order-column/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [alessio.rosi](https://wordpress.org/support/users/alessiorosi/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-filter-by-payment/#post-17023656)
 * Status: resolved