- copy your image (
Ctrl+A
andCtrl+C
) - make a new document-sized pure-black layer behind it
- group the black layer and yor image together
- add mask to the group
- enter mask edit mode (
alt+click
on the mask icon/thumbnail) - paste your image in the mask (b/w) and then invert it.
- save it as a 24-bit transparent PNG
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 { useEffect, useRef } from 'react'; | |
import { useHistory } from 'react-router-dom'; | |
export const usePrompt = (when: boolean, message: string = 'Are you sure you want to quit without saving your changes?') => { | |
const history = useHistory(); | |
const self = useRef(null); | |
const onWindowOrTabClose = event => { | |
if (!when) { |
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
{ | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { | |
"project": "./tsconfig.json", | |
"tsconfigRootDir": "." | |
}, | |
"env": { | |
"browser": true, | |
"jest/globals": true | |
}, |
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
<?php | |
class woocommerce_acf_variations { | |
/**/ | |
static function setup() { | |
/* Add this form to variations */ | |
add_action( 'admin_head','acf_form_head', 20 ); | |
add_action( 'woocommerce_product_after_variable_attributes', 'woocommerce_acf_variations::variation_field_group', 99, 3 ); | |
add_action( 'woocommerce_product_thumbnails', 'woocommerce_acf_variations::display_thumbs', 99, 3 ); |