Skip to content

Instantly share code, notes, and snippets.

View topmask's full-sized avatar
🤩
Out sick

Allen Smith topmask

🤩
Out sick
View GitHub Profile
<?php
/**
* Admin new order email
*/
$order = new WC_order( $item_data->order_id );
echo "= " . $email_heading . " =\n\n";
$opening_paragraph = __( 'A new order has been made by %s. The details of the item are as follows:', 'custom-email' );
@topmask
topmask / custom-item-email-html.php
Created October 29, 2021 13:52 — forked from pinalj/custom-item-email-html.php
The HTML Email Template
<?php
/**
* Admin new order email
*/
$order = new WC_order( $item_data->order_id );
$opening_paragraph = __( 'A new order has been made by %s. The details of the item are as follows:', 'custom-email' );
?>
<?php do_action( 'woocommerce_email_header', $email_heading ); ?>
@topmask
topmask / custom-email-manager.php
Created October 29, 2021 13:52 — forked from pinalj/custom-email-manager.php
This file contains the code to include email classes and trigger custom emails.
<?php
/**
* Handles email sending
*/
class Custom_Email_Manager {
/**
* Constructor sets up actions
*/
public function __construct() {
@topmask
topmask / WordPress Contact Form
Created October 29, 2021 13:43
How To Build Your Own WordPress Contact Form
<?php
//response generation function
$response = "";
//function to generate response
function my_contact_form_generate_response($type, $message){
global $response;
@topmask
topmask / Contact form functionality
Created October 29, 2021 13:08
Contact form functionality
<?php
/**
* Contact form functionality
* Used within the loop
* @link https://developer.wordpress.org/reference/functions/wp_nonce_field/
* @link https://codex.wordpress.org/Class_Reference/WP_Error
* @link https://developer.wordpress.org/reference/functions/wp_is_mobile/
* @link https://developer.wordpress.org/reference/functions/wp_kses_data/
* @link https://developer.wordpress.org/reference/functions/wp_remote_retrieve_response_code/
* @link https://developer.wordpress.org/reference/functions/wp_get_referer/
@topmask
topmask / Contact form functionality
Created October 29, 2021 13:06
Contact form functionality
<?php
/**
* Contact form functionality
* Used within the loop
* @link https://developer.wordpress.org/reference/functions/wp_nonce_field/
* @link https://codex.wordpress.org/Class_Reference/WP_Error
*/
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
@topmask
topmask / Customize WooCommerce Cart, Checkout, and Account Pages
Created October 29, 2021 12:17
Customize WooCommerce Cart, Checkout, and Account Pages
/*****************************************************/
/******** WOO CART / CHECKOUT / ACCOUNT PAGES ********/
/*****************************************************/
/*** MAIN FORMS BACKGROUND COLOR ***/
.woocommerce table.shop_table,
.woocommerce form.checkout_coupon,
.woocommerce form.login,
.woocommerce form.register,
#add_payment_method #payment,
@topmask
topmask / Adding a Icon to External Links
Last active October 29, 2021 11:54
Adding a Icon to External Links
@topmask
topmask / 从WordPress管理仪表板上完全删除jQuery
Created October 29, 2021 11:18
从WordPress管理仪表板上完全删除jQuery
/** * Completely Remove jQuery From WordPress Admin Dashboard */
add_action('wp_enqueue_scripts', 'no_more_jquery');
function no_more_jquery(){
wp_deregister_script('jquery');
}
@topmask
topmask / 安装最新的jQuery版本
Created October 29, 2021 11:17
安装最新的jQuery版本
/** * Install latest jQuery version 3.4.1. */
if (!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', ("https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"), false);
wp_enqueue_script('jquery');
}