$( 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 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 | |
/** | |
* Put this into your functions.php of your child-theme or custom plugin | |
* you can create the role with wp-cli by running `wp shell` and running the command: | |
* add_role('merchant','Merchant',array('read' => true, 'delete_posts' => false) ); | |
*/ | |
/** | |
* Step #1: create the field used to store the new sale_price for product_variation and for products | |
*/ |
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 REST API Grid Block | |
Description: A Gutenberg block that fetches posts via the REST API and displays them in a grid. | |
Version: 1.0 | |
Author: Your Name | |
*/ | |
if (!defined('ABSPATH')) { | |
exit; // Exit if accessed directly. |
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 | |
/** | |
* Declare WooCommerce HPOS compatibility | |
*/ | |
function yourplugin_declare_hpos_compat() { | |
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { | |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); | |
} | |
} | |
add_action( 'before_woocommerce_init', 'yourplugin_declare_hpos_compat' ); |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
- There are always 24 hours in a day.
- February is always 28 days long.
- Any 24-hour period will always begin and end in the same day (or week, or month).
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 | |
// Customized the comment form fields ( not the comment text area ) | |
add_filter('comment_form_default_fields', 'my_comment_form_args'); | |
// Customizes the text area - you have to do this here, rather than in comment_form_default_fields | |
add_filter('comment_form_field_comment', 'my_comment_form_field_comment'); | |
// Customized the comment notes above the form fields | |
add_filter( 'comment_form_defaults', 'my_comment_form_defaults' ); |
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_add_error', 'woocommerceAddError' ); | |
/** | |
* Remove billing from the validation message | |
* @see wc_add_notice | |
* | |
* @param $error | |
* @return string|string[] | |
*/ | |
function woocommerceAddError ( $error ) |
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
#!/bin/bash | |
# Script to update a firewall rule in a Hetzner Firewall with your current IP address. | |
# Good if you would like to restrict SSH access only for your current IP address (secure). | |
################# | |
# WARNING: This script will overwrite all rules in the firewall rules, so make sure you | |
# added all the required rules. | |
# I use a separate firewall rule just for SSH access. | |
################# |
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: WooCommerce Product Collections | |
Plugin URI: http://upnrunn.com | |
Description: Set WooCommerce Product Collections based on Price range | |
Author: Kishore Sahoo | |
Version: 0.0.1 | |
Author URI: http://upnrunn.com | |
*/ |
NewerOlder