Skip to content

Instantly share code, notes, and snippets.

View marcosnakamine's full-sized avatar

Marcos Nakamine marcosnakamine

View GitHub Profile
@ashokmhrj
ashokmhrj / woo-hooks.php
Last active February 9, 2023 12:16
Woocommerce sale flash in percentage
<?php
/**
* shows percentage in flash sales
*/
add_filter( 'woocommerce_sale_flash', 'ask_percentage_sale', 11, 3 );
function ask_percentage_sale( $text, $post, $product ) {
$discount = 0;
if ( $product->get_type() == 'variable' ) {
$available_variations = $product->get_available_variations();
@contactjavas
contactjavas / phpcs-wpcs-on-windows.md
Last active March 25, 2025 18:23
Install phpcs (PHP_CodeSniffer) + wpcs (WordPress Coding Standards) on Windows

Setup CLI

Install PHPCS via Composer

composer global require "squizlabs/php_codesniffer=*"

Install WPCS via Composer

composer global require "wp-coding-standards/wpcs"

Add WPCS to PHPCS

phpcs --config-set installed_paths %APPDATA%\Composer\vendor\wp-coding-standards\wpcs