Skapar egna produktalternativ

/* LÄGGER TILL BESKRIVNING UNDER PRISET FÖR PRODUKTER EJ I LAGER ELLER EJ KÖPBAR */ add_action( ‘woocommerce_single_product_summary’, ‘visa_produktbeskrivning’, 40 ); function visa_produktbeskrivning() { global $product; if ( ! $product->is_in_stock() || $product->get_stock_status() == ‘ej-kop’ ) { echo ‘ ‘; echo apply_filters(…Continue reading

Disable Attachment Pages (copy)

add_action( ‘template_redirect’, function () { global $post; if ( ! is_attachment() || ! isset( $post->post_parent ) || ! is_numeric( $post->post_parent ) ) { return; } // Does the attachment have a parent post? // If the post is trashed, fallback…Continue reading

Woo – Prijs vanaf

add_filter(‘woocommerce_variable_price_html’, ‘custom_variation_price’, 10, 2); function custom_variation_price($price, $product) { $price = ”; $min_price = $product->get_variation_price(‘min’, true); $price .= sprintf(__(‘Ab: %1$s’, ‘woocommerce’), wc_price($min_price)); return $price; }Continue reading

Gravity Custom Code

/* ————————————————————————- * * Gravity Form: Replace custom merge tags /* ————————————————————————- */ add_filter( ‘gform_replace_merge_tags’, function ( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) { if ( strpos( $text, ‘{current_hour}’ ) !== false ) { $text = str_replace( ‘{current_hour}’,…Continue reading

Allow JS Files Upload

/** * Allow JS uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Allow CSS Files Upload

/** * Allow CSS uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading