From b991617ff7081c1098f3d66460878e1163ac8426 Mon Sep 17 00:00:00 2001 From: daniel von mitschke Date: Sat, 12 Jul 2014 14:30:43 +0200 Subject: [PATCH] adding default product visibility filter hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a filter hook ‚woocommerce_product_visibility_default’ to set the default visibility option on new products --- includes/admin/class-wc-admin-post-types.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/class-wc-admin-post-types.php b/includes/admin/class-wc-admin-post-types.php index 16300f3a56d..1f56a846150 100644 --- a/includes/admin/class-wc-admin-post-types.php +++ b/includes/admin/class-wc-admin-post-types.php @@ -1910,7 +1910,7 @@ class WC_Admin_Post_Types { return; } - $current_visibility = ( $current_visibility = get_post_meta( $post->ID, '_visibility', true ) ) ? $current_visibility : 'visible'; + $current_visibility = ( $current_visibility = get_post_meta( $post->ID, '_visibility', true ) ) ? $current_visibility : apply_filters( 'woocommerce_product_visibility_default' , 'visible' ); $current_featured = ( $current_featured = get_post_meta( $post->ID, '_featured', true ) ) ? $current_featured : 'no'; $visibility_options = apply_filters( 'woocommerce_product_visibility_options', array(