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
@topmask
topmask / product_key_features.php
Created October 30, 2021 10:18 — forked from tdmrhn/product_key_features.php
Product Key Features Field
<?php
// Display Input Field on Backend
add_action( 'woocommerce_product_options_general_product_data', function () {
global $woocommerce, $post;
echo '<div class="options_group">';
woocommerce_wp_text_input(
array(
'id' => 'product_key_features',
'label' => __( 'Product Key Features', 'woocommerce' ),
'placeholder' => 'Enter product key features (3 words)',
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
<?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