This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_get_price_html', 'custom_price_html', 100, 2 ); | |
function custom_price_html( $price, $product ){ | |
$price .= ' + free shipping'; | |
return $price; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( ‘woocommerce_get_availability’, ‘custom_override_get_availability’, 10, 2); | |
// The hook in function $availability is passed via the filter! | |
function custom_override_get_availability( $availability, $_product ) { | |
if ( $_product->is_in_stock() ) $availability[‘availability’] = __(‘In stock’, ‘woodmart’); | |
return $availability; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_upsell_display_args', 'change_upsell_order', 20 ); | |
function change_upsell_order( $args ) { | |
$args['orderby'] = 'date'; | |
$args['order'] = 'DESC'; // set ASC for oldest to newest | |
return $args; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shop_title( $title ) { | |
if ( is_shop() && isset( $title['title'] ) ) { | |
$title['title'] = apply_filters( 'the_title', get_the_title( get_option( 'woocommerce_shop_page_id' ) ) ); | |
} | |
return $title; | |
} | |
add_filter( 'document_title_parts', 'shop_title' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Uncheck follow-up replies via email checbox | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description When you're on the WordPress.org forum, the system automatically selects the checkbox to receive follow-up replies via email. However, you don't have to subscribe to all threads as a support representative. This script will automatically uncheck this box. | |
// @author Shameem Reza | |
// @match https://wordpress.org/support/topic/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteCond %{HTTPS} on | |
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/ [NC] | |
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/ [NC] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)(\.jpg|\.jpeg|\.png|\.gif|\.js|\.css)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_allow_marketplace_suggestions', '__return_false' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove options from the Product Data Panel in WooCommerce | |
function remove_product_data_tabs( $tabs ) { | |
//unset( $tabs['general'] ); | |
unset( $tabs['inventory'] ); | |
unset( $tabs['shipping'] ); | |
unset( $tabs['linked_product'] ); | |
//unset( $tabs['attribute'] ); | |
//unset( $tabs['variations'] ); | |
//unset( $tabs['advanced'] ); | |
return $tabs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useRef } from 'react'; | |
import { Input } from './Input'; | |
const App = () => { | |
const inputRef = useRef(null); | |
const handleSubmit = (event) => { | |
event.preventDefault(); | |
const value = inputRef.current.getValue(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { forwardRef, useRef } from 'react'; | |
const Input = forwardRef((props, ref) => { | |
const inputRef = useRef(null); | |
const getValue = () => { | |
return inputRef.current.value; | |
} | |
const isValid = () => { |
NewerOlder