Skip to content

Instantly share code, notes, and snippets.

View SeanTOSCD's full-sized avatar
👋
Reach out.

Sean Davis SeanTOSCD

👋
Reach out.
View GitHub Profile
@SeanTOSCD
SeanTOSCD / JavaExpressionsHW.java
Last active May 30, 2023 22:18
Basic Arithmetic Expressions in Java
/**
* Basic Expressions
*
* @author Sean Davis
*/
package edu.umsl;
import java.util.Scanner;
@SeanTOSCD
SeanTOSCD / file.php
Created March 21, 2020 14:52
Volatyl - Order download categories and tags alphabetically
<?php // DO NO COPY THIS LINE
/**
* Modify various queries
*
* @param $query
*/
function vol_custom_pre_get_posts( $query ) {
if ( is_admin() ) {
@SeanTOSCD
SeanTOSCD / file.php
Last active July 31, 2024 13:12
EDD - bulk edit variable price options more ALL downloads
<?php // DO NOT COPY THIS LINE
/**
* Bulk edit all downloads with variable price options
*
* This code should only be executed when needed. The purpose is to find
* all downloads with variable pricing, and update their respective variable
* pricing labels (Option Name) based strings given in the custom function.
*
* The easiest way to use the function is with the following WordPress plugins:
@SeanTOSCD
SeanTOSCD / file.php
Created January 2, 2020 16:58
Themedd copyright edit
<?php // DO NOT COPY THIS LINE
/**
* Filter the Themedd copyright text for custom output
*/
function custom_themedd_copyright( $copyright ) {
$copyright = 'Custom copyright &copy; text with year (' . date( 'Y' ) . ') and site name (' . get_bloginfo( 'name' ) . ')!' ;
@SeanTOSCD
SeanTOSCD / file.php
Created November 8, 2019 18:37
EDD checkout form - move login form to checkout cart (custom)
<?php // DO NOT COPY THIS LINE
// PLEASE READ ALL COMMENTS
/**
* This is being provide as-is directly from a custom implementation I built for the checkout form on easydigitaldownloads.com.
* It's not just this part that is custom. I made various changes to the entire checkout cart, form, and behavior. So context
* matters. The code below is specific to repositioning the login form, putting it behind a toggle link, and making sure the
* form still submits via AJAX. While this will get you most of the way, you'll have to make tweaks based on your own code.
*
@SeanTOSCD
SeanTOSCD / account-dashboard.php
Created September 16, 2019 19:22
EDD Site Account Dashboard page
<?php
/**
* Content for the Account Dashboard tab on the Account page / The Main Account Page
*/
global $current_user;
$customer = '';
if ( class_exists( 'Easy_Digital_Downloads' ) ) {
@SeanTOSCD
SeanTOSCD / file.php
Created December 16, 2017 19:37
FES show custom user meta on vendor order
<?php // DO NOT COPY THIS LINE
function sd_edd_fes_custom_user_meta( $payment ) {
$user = edd_get_payment_meta_user_info( $payment->ID );
?>
<tr>
<td><strong><?php _e( 'Phone', 'easy-digital-downloads' ); ?>:</strong></td>
<td><?php echo get_user_meta( $user['id'], 'phone_number', true ); ?></td>
</tr>
<?php
@SeanTOSCD
SeanTOSCD / file.php
Created September 9, 2017 19:07
EDD Checks Gateway Email Customization
<?php // DO NOT COPY THIS LINE
// Checks Gateway email subject adjustment
function sd_eddcg_custom_admin_notification_subject( $subject ) {
$subject = 'New Pending Offline Donation';
return $subject;
}
add_filter( 'eddcg_admin_purchase_notification_subject', 'sd_eddcg_custom_admin_notification_subject' );
// Checks Gateway email body adjustments
@SeanTOSCD
SeanTOSCD / file.php
Created August 31, 2017 19:28
EDD prevent duplicate cart items
<?php // DO NOT COPY THIS LINE
/**
* Prevents items from being added to the cart multiple times
*
*/
function pw_edd_prevent_duplicate_cart_items( $download_id, $options ) {
if( edd_item_in_cart( $download_id, $options ) ) {
if( edd_is_ajax_enabled() ) {
wp_redirect( edd_get_checkout_uri() ); exit;
@SeanTOSCD
SeanTOSCD / file.php
Created August 30, 2017 22:43
EDD Stripe replace CC form
<?php // DO NOT COPY THIS LINE
function custom_edd_stripe_new_card_form() {
?>
<p id="edd-card-number-wrap">
<label for="card_number" class="edd-label">
<?php _e( 'Card Number', 'edds' ); ?>
<span class="edd-required-indicator">*</span>
<span class="card-type"></span>
</label>