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 = () => { |
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 React from "react"; | |
function EmployeeList(props) { | |
const employees = props.employees; | |
const employeeList = employees.map((employee) => ( | |
<div key={employee.id}> | |
<h2>{employee.name}</h2> | |
<p>Age: {employee.age}</p> | |
<p>Position: {employee.position}</p> |
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 React from "react"; | |
import EmployeeList from "./EmployeeList"; | |
function App() { | |
const employees = [ | |
{ name: "John Doe", age: 25, position: "Software Engineer" }, | |
{ name: "Jane Smith", age: 32, position: "Product Manager" }, | |
{ name: "Mike Johnson", age: 27, position: "UI/UX Designer" }, | |
{ name: "Sarah Lee", age: 30, position: "Marketing Manager" }, | |
]; |
NewerOlder