Skip to content

Instantly share code, notes, and snippets.

View shivapoudel's full-sized avatar
🎯
Focusing

Shiva Poudel shivapoudel

🎯
Focusing
View GitHub Profile
@shivapoudel
shivapoudel / woocommerce.md
Last active October 27, 2017 17:34
Transactional and Notificational Emails trigger hooks :)

Order Statuses:

'wc-pending'    => _x( 'Pending payment', 'Order status', 'woocommerce' ),
'wc-processing' => _x( 'Processing', 'Order status', 'woocommerce' ),
'wc-on-hold'    => _x( 'On hold', 'Order status', 'woocommerce' ),
'wc-completed'  => _x( 'Completed', 'Order status', 'woocommerce' ),
'wc-cancelled'  => _x( 'Cancelled', 'Order status', 'woocommerce' ),
'wc-refunded'   => _x( 'Refunded', 'Order status', 'woocommerce' ), // Excluded
'wc-failed' => _x( 'Failed', 'Order status', 'woocommerce' ), // Excluded
@shivapoudel
shivapoudel / functions.php
Created January 12, 2018 06:24
WP REST API - Modify API base URL prefix.
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'rest_url_prefix', 'custom_rest_url_prefix' );
/**
* Modify url base from 'wp-json' to 'api' prefix.
*/
@shivapoudel
shivapoudel / functions.php
Last active January 18, 2018 10:33
WooCommerce - Automatically add product to cart on visit
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
if ( class_exists( 'WooCommerce' ) ) {
add_action( 'template_redirect', 'wc_auto_add_product_to_cart' );
}
/**
@shivapoudel
shivapoudel / functions.php
Created February 3, 2018 09:14
WooCommerce - Prevent order view link being triggered on row click
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
if ( class_exists( 'WooCommerce' ) ) {
add_action( 'post_class', 'wc_order_post_class', 20, 3 );
}
/**
@shivapoudel
shivapoudel / functions.php
Created April 12, 2018 08:37
WooCommerce - Remove all filters for formatted order total
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_action( 'plugins_loaded', 'remove_wc_get_formatted_order_total_filters' );
/**
* Remove all filters for WC formatted order total.
*/
@shivapoudel
shivapoudel / functions.php
Created April 13, 2018 06:54
WooCommerce - Change order button text strings
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'gettext', 'custom_order_button_strings', 20 );
/**
* Change order button text strings.
*
@shivapoudel
shivapoudel / everest-forms-auto-updates.php
Created June 11, 2019 06:40
Auto-updates Everest Forms to the latest stable version.
<?php
/**
* Plugin Name: Everest Forms - Auto Updates
* Plugin URI: https://github.com/wpeverest/everest-forms-auto-updates
* Description: Auto-updates Everest Forms to the latest stable version.
* Version: 1.0.0
* Author: WPEverest
* Author URI: https://wpeverest.com
* License: GPLv3 or later
*
@shivapoudel
shivapoudel / commands.sh
Last active October 8, 2019 13:07
Docker reset
docker system prune -f --volumes
docker container prune -f
docker container stop $(docker container ls -aq)
docker container rm $(docker container ls -aq)
docker image prune -f -a
docker volume prune -f
docker network prune -f
@shivapoudel
shivapoudel / functions.php
Last active July 21, 2020 07:30
Everest Forms - Support reCAPTCHA v2 Language code. (Updated for 1.7.0)
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'everest_forms_frontend_recaptcha_url', 'evf_recaptcha_lang_code', 10, 2 );
/**
* Language code support for reCAPTCHA v2.
*
@shivapoudel
shivapoudel / functions.php
Created January 17, 2018 09:37
WooCommerce - Enable REST API permissions check
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'woocommerce_rest_check_permissions', '__return_true' );