Archives: Snippets
Untitled Snippet
ghmsnnip
Changes the default recipe author name in Tasty Recipes
add_filter( ‘tasty_recipes_default_author_name’, function() { return ‘Your New Default Author Name’; } );Continue reading
Add a “Rate this recipe” Tasty Recipes quick link
add_filter( ‘tasty_recipes_quick_links’, function( $links ) { $links[] = ‘Rate this Recipe‘; return $links; } );Continue reading
Prevent Tasty Links inside Tasty Recipes
add_action( ‘init’, function() { // Remove Tasty Links from Tasty Recipes description, notes, ingredients, and instructions. remove_filter( ‘tasty_recipes_the_content’, array( ‘Tasty_LinksIntegrationsTasty_Recipes’, ‘filter_tasty_recipes_content’ ) ); });Continue reading
Hide nutrition facts for Tasty Recipes printing
add_filter( ‘tasty_recipes_print_view_buttons’, ‘wpt_hide_nutrition_button’ ); function wpt_hide_nutrition_button( $buttons ) { unset( $buttons[‘nutrition’] ); return $buttons; }Continue reading
pdf page count
Untitled Snippet
Make Product Non Purchasable for Wholesale Customer if Product Stock is Less Than Certain Amount
/* Make Product Non Purchasable for Wholesale Customer Iif Product Stock is Less Than X Amount */ add_filter( ‘woocommerce_is_purchasable’, ‘wwpp_limit_purchase_based_on_stock’, 10, 2 ); function wwpp_limit_purchase_based_on_stock( $is_purchasable, $product ) { //Get Product Stock Quantity $product_quantity = $product->get_stock_quantity(); //Get current user’s wholesale…Continue reading