add_action( ‘woocommerce_before_single_product’, ‘custom_check_variations_stock_status’ ); function custom_check_variations_stock_status() { global $product; if ( $product->is_type( ‘variable’ ) ) { $variations = $product->get_available_variations(); $all_out_of_stock = true; foreach ( $variations as $variation ) { if ( $variation[‘is_in_stock’] ) { $all_out_of_stock = false; break; } }…Continue reading
function fn_currentyear () { $year = date_i18n (‘Y’); return $year; } add_shortcode (‘currentyear’, ‘fn_currentyear’);Continue reading
/** * @link https://library.wpcode.com/snippet/323j86jo/ */ add_filter( ‘simpay_decimal_places’, function() { return 0; } );Continue reading
add_filter( ‘tasty_recipes_min_rating_without_comment’, function() { return 6; // Require comments for 4 and 5 star ratings too. } );Continue reading
function reading_time() { if ( empty( $post ) && isset( $GLOBALS[‘post’] ) ) { $post = $GLOBALS[‘post’]; $content = get_post_field( ‘post_content’, $post->ID ); $word_count = str_word_count( strip_tags( $content ) ); $readingtime = ceil($word_count / 260); if ($readingtime == 1) {…Continue reading
add_filter( ‘body_class’, function( $classes ) { $acc_type=tmwp_get_user_role(); if (!$acc_type) $acc_type=’anonymous’; return array_merge( $classes, array(‘acc-type-‘.strtolower($acc_type),tmwp_get_page_class()) ); } );Continue reading
add_action( ‘init’, ‘custom_logout’ ); function custom_logout() { if ( strpos($_SERVER[‘REQUEST_URI’], ‘/customer-logout’) !== false ) { wp_logout(); $redirect_url = home_url(); wp_safe_redirect($redirect_url); exit; } }Continue reading
function insert_nort_proof() { $nortbeam_script = ‘‘; $proof_script = ‘‘; echo $nortbeam_script; echo $proof_script; } add_action( “wp_head”, “insert_nort_proof”, 0 );Continue reading