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 | |
/* | |
Plugin Name: wp_filter functions | |
Plugin URI: http://www.damiencarbery.com/2017/06/list-functions-attached-to-an-action/ | |
Description: List functions attached to all actions and filters. DON'T DO IT! | |
Author: Damien Carbery | |
Version: 0.1 | |
*/ | |
add_action( 'wp_head', 'wp_filter_the_wrong_way' ); |
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
Workato | |
Apiant | |
Inegromat | |
Snaplogic | |
CloudHQ | |
Boomi | |
Tibco | |
Jitterbit | |
AWS Lambda | |
Mulesoft |
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 | |
/** | |
* Plugin Name: Conditional WooCommerce Checkout Fields | |
* Description: Adds the abilitiy to conditionally show / hide checkout fields. | |
* Version: 1.0 | |
* Author: Caleb Burks | |
* Author URI: http://calebburks.com | |
*/ | |
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 | |
/** | |
* Skip cart and redirect to direct checkout | |
* | |
* @package WooCommerce | |
* @version 1.0.0 | |
* @author Alessandro Benoit | |
*/ | |
// Skip the cart and redirect to check out url when clicking on Add to cart |
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
/* | |
* Custom AJAX spinner on WooCommerce checkout | |
* The class used to load the overlay is .blockUI .blockOverlay | |
* The class used to load the spinner is .woocommerce .loader:before | |
* | |
*/ | |
.woocommerce .blockUI.blockOverlay:before,.woocommerce .loader:before { | |
height: 3em; | |
width: 3em; | |
position: absolute; |
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 // Don't add this line if inserting in a functions.php file. | |
add_filter( 'wp_nav_menu_items', function( $items, $args ) { | |
// Only used on main menu | |
if ( 'main_menu' != $args->theme_location ) { | |
return $items; | |
} | |
// Add custom item |
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 // do not copy this line | |
/** | |
* This will turn the shop page permalink into a link for the home page. | |
* @param str $link The permalink that's presently being filtered. | |
* @return str The permalink you'd like to send instead. | |
*/ | |
function jp_woocommerce_get_shop_page_permalink( $link ) { | |
$link = get_home_url(); | |
return $link; |
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_checkout_fields' , 'custom_remove_woo_checkout_fields' ); | |
function custom_remove_woo_checkout_fields( $fields ) { | |
// remove billing fields | |
unset($fields['billing']['billing_first_name']); | |
unset($fields['billing']['billing_last_name']); | |
unset($fields['billing']['billing_company']); | |
unset($fields['billing']['billing_address_1']); | |
unset($fields['billing']['billing_address_2']); |
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
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
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_order_number', 'change_woocommerce_order_number', 1, 2); | |
function change_woocommerce_order_number( $order_id, $order ) { | |
$prefix = '#SAM-'; | |
$suffix = '-' . date(Y); | |
return $prefix . $order->id . $suffix; | |
} |