Issue with Code Snippets Plugin: Bug?
-
So, I found the following code:
function sv_remove_product_page_skus( $enabled ) { if ( ! is_admin() && is_product() ) { return false; } return $enabled; } add_filter( 'wc_product_sku_enabled', 'sv_remove_product_page_skus' );
So, I installed Code Snippets 2.4.1, pasted that code into the code window and enabled it and the whole site breaks. Thankfully I found the Code Snippets FAQ and turned on safe mode, deactivated the snippet, and began experimenting with code sequencing and application.
I did find a fix… I found that if I separated
add_filter( 'wc_product_sku_enabled', 'sv_remove_product_page_skus' );
from
function sv_remove_product_page_skus( $enabled ) { if ( ! is_admin() && is_product() ) { return false; } return $enabled; }
by inserting it into a separate code snippet everything works.
I am new to WordPress and website admin so this is quite challenging… patching / fixing / removing this need to separate the add_filter ?function? would be great!
- The topic ‘Issue with Code Snippets Plugin: Bug?’ is closed to new replies.