Code-Snippets-Functions/Execute a function on a child site/Ajax Search for WooCommerce/include-private-posts-in-search.txt

7 lines
191 B
Text

add_filter( 'dgwt/wcas/search_query/args', function ( $args ) {
if ( current_user_can( 'manage_options' ) ) {
$args['post_status'] = [ 'publish', 'private' ];
}
return $args;
} );