Created
March 6, 2018 04:29
-
-
Save rayflores/076d39c1b65153a82a57c9c7a7bbc297 to your computer and use it in GitHub Desktop.
WooCommerce Make Orders Table Rows Not Clickable
This file contains 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 | |
/* Plugin Name: WooCommerce Orders Table Rows Not Clickable | |
* Plugin URI: https://rayflores.com | |
* Description: Orders table rows are no longer clickable on <td> element | |
* Version: 1.0 | |
* Author: Ray Flores | |
* Author URI: https://rayflores.com | |
*/ | |
/** | |
* Add "no-link" class to tr's from WooCommerce orders screen | |
* Link: https://github.com/woocommerce/woocommerce/pull/18708 | |
* Hook reference: https://developer.wordpress.org/reference/hooks/post_class/ | |
* Tested with: WooCommerce 3.3.3 | |
*/ | |
add_filter( 'post_class', function( $classes ) { | |
if ( is_admin() ) { | |
$current_screen = get_current_screen(); | |
if ( $current_screen->base == 'edit' && $current_screen->post_type == 'shop_order' ) $classes[] = 'no-link'; | |
} | |
return $classes; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment