mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
7 lines
295 B
Text
7 lines
295 B
Text
add_filter( 'posts_where', 'bbloomer_no_private_products_posts_frontend_administrator' );
|
|
|
|
function bbloomer_no_private_products_posts_frontend_administrator( $where ) {
|
|
if ( is_admin() ) return $where;
|
|
global $wpdb;
|
|
return " $where AND {$wpdb->posts}.post_status != 'private' ";
|
|
}
|