Add WooCommerce Orders as a SearchWP Source.
<?php | |
// Add WooCommerce Orders as a SearchWP Source. | |
// @link https://searchwp.com/documentation/knowledge-base/search-woocommerce-orders/ | |
add_action( 'plugins_loaded', function() { | |
add_filter( 'searchwp\sources', function( $sources ) { | |
$sources[] = new \SearchWP\Sources\Post( 'shop_order' ); | |
return $sources; | |
} ); | |
add_filter( 'searchwp\post_stati\shop_order', function( $post_stati ) { | |
return array_merge( $post_stati, [ | |
'wc-pending', | |
'wc-processing', | |
'wc-on-hold', | |
'wc-completed', | |
'wc-cancelled', | |
'wc-refunded', | |
'wc-failed', | |
] ); | |
} ); | |
} ); |
This comment has been minimized.
This comment has been minimized.
It works now... my bad... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
The
shop_order
is unknown post type. This return an error.