Last active
July 2, 2020 05:22
-
-
Save rynaldos-zz/2a87b75c84235a2d4ea20ccefb4853be to your computer and use it in GitHub Desktop.
[WooCommerce 3.0] Change placeholder image
This file contains hidden or 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_action( 'init', 'custom_fix_thumbnail' ); | |
| function custom_fix_thumbnail() { | |
| add_filter('woocommerce_placeholder_img_src', 'custom_woocommerce_placeholder_img_src'); | |
| function custom_woocommerce_placeholder_img_src( $src ) { | |
| $upload_dir = wp_upload_dir(); | |
| $uploads = untrailingslashit( $upload_dir['baseurl'] ); | |
| $src = $uploads . '/2012/07/thumb1.jpg'; | |
| return $src; | |
| } | |
| } | |
| // Did this help? Donate me some BTC: 1BEsm8VMkYhSFJ92cvUYwxCtsfsB2rBfiG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment