- A Pen is worth a thousand docs.
- Be the developer your linter thinks you are.
- How do you comfort a JavaScript bug? You console it!
- How would you React if I said I love Vue?
- If a groundhog inspects their Web Component, do they see their Shadow DOM?
- If you get tired, be like an AJAX request and REST.
- If you want to
flex
your skills and go off thegrid
, try coding a layout withfloat
. - Keep friends close and formatters closer.
- Keep the
<main>
thing the<main>
thing. - Knock knock! Race condition. Who's there?
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
<?php | |
// Add a new column to the orders list | |
add_filter( 'manage_edit-shop_order_columns', 'add_coupon_code_column', 20 ); | |
function add_coupon_code_column( $columns ) { | |
// Insert the new column after the 'order_status' column | |
$new_columns = array(); | |
foreach ( $columns as $key => $column ) { | |
$new_columns[ $key ] = $column; | |
if ( 'order_status' === $key ) { | |
$new_columns['coupons_used'] = __( 'Coupons Used', 'your-textdomain' ); |
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
// Get The Page ID You Need | |
get_option( 'woocommerce_shop_page_id' ); | |
get_option( 'woocommerce_cart_page_id' ); | |
get_option( 'woocommerce_checkout_page_id' ); | |
get_option( 'woocommerce_pay_page_id' ); | |
get_option( 'woocommerce_thanks_page_id' ); | |
get_option( 'woocommerce_myaccount_page_id' ); | |
get_option( 'woocommerce_edit_address_page_id' ); | |
get_option( 'woocommerce_view_order_page_id' ); | |
get_option( 'woocommerce_terms_page_id' ); |
$( document.body ).trigger( 'init_checkout' );
$( document.body ).trigger( 'payment_method_selected' );
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'checkout_error' );
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
define( 'WP_REDIS_IGNORED_GROUPS', [ 'options' ]); |
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
<?php | |
/** | |
* Payment Gateway Base Class | |
* | |
* You can extend this class to add support for a custom gateway. | |
* @link http://docs.restrictcontentpro.com/article/1695-payment-gateway-api | |
* | |
* @package Restrict Content Pro | |
* @subpackage Classes/Gateway | |
* @copyright Copyright (c) 2017, Pippin Williamson |
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
function hello_elementor_child_enqueue_scripts() { | |
wp_enqueue_style( | |
'hello-elementor-child-style', | |
get_stylesheet_directory_uri() . '/style.css', | |
[ | |
'hello-elementor-theme-style', | |
], | |
'1.0.0' | |
); | |
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
function mysite_pending($order_id) { | |
error_log("$order_id set to PENDING", 0); | |
} | |
function mysite_failed($order_id) { | |
error_log("$order_id set to FAILED", 0); | |
} | |
function mysite_hold($order_id) { | |
error_log("$order_id set to ON HOLD", 0); | |
} | |
function mysite_processing($order_id) { |
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
<?php | |
// This code is based in Mathew Horne blog post: https://matthewhorne.me/defer-async-wordpress-scripts/ | |
//function to add async attribute | |
function add_async_attribute($tag, $handle) { | |
$scripts_to_async = array('my-js-handle-async', 'another-handle-async'); | |
//check if this script is in the array | |
if (in_array($handle, $scripts_to_async)){ | |
//return with async | |
return str_replace(' src', ' async="async" src', $tag); |
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
//maps.googleapis.com | |
//maps.gstatic.com | |
//fonts.googleapis.com | |
//fonts.gstatic.com | |
//ajax.googleapis.com | |
//apis.google.com | |
//google-analytics.com | |
//www.google-analytics.com | |
//ssl.google-analytics.com | |
//youtube.com |
NewerOlder