Skip to content

Instantly share code, notes, and snippets.

@JRyven
JRyven / wp-config.php
Created July 21, 2022 17:16
WordPress Debugging Options
// general PHP and WordPress warnings, error messages and status information
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WPS_DEBUG', true );
// script and style
define( 'WPS_DEBUG_SCRIPTS', true );
@JRyven
JRyven / functions.php
Created February 17, 2022 18:20
WooCommerce Automatically Create and Apply Discount Coupons Based on WordPress User Role
<?php
/* Role_Based_Pricing
*
*
*
*/
/* Role_Based_Pricing_Get_User
@JRyven
JRyven / functions.php
Created December 29, 2021 02:30
Animation Box for WordPress - Creates tiles with never-duplicating, stacking image animations using OOP PHP and CSS only
<?php
class Animation_Box {
public $assets;
public $used_assets;
public function __construct( $frank_assets ){
$this->assets = $frank_assets;
$this->Animation_Box_shortcodes();
@JRyven
JRyven / functions.php
Last active October 26, 2021 08:45
Add a simple button to the WordPress administrator toolbar that will remove the admin toolbar from the DOM.
<?php
/* Click_Hide_Admin_Toolbar
*
*
*/
class Click_Hide_Admin_Toolbar {
@JRyven
JRyven / twilio__text___functions.php
Last active October 26, 2021 08:42
Trigger Twilio Text Message as a result of form submission
<?php
/**
* Send Information to Twilio, Require SKD https://www.twilio.com/docs/libraries/php
*
*
*/
require __DIR__ . '/twilio/Twilio/autoload.php';
use Twilio\Rest\Client;
@JRyven
JRyven / twilio__text___functions.php
Last active October 26, 2021 08:42
Trigger Twilio MMS when MMS is Received
<?php
/**
* Send Information to Twilio, Require SKD https://www.twilio.com/docs/libraries/php
*
*
*/
require __DIR__ . '/twilio/Twilio/autoload.php';
use Twilio\Rest\Client;
@JRyven
JRyven / functions.php
Created April 20, 2021 09:12
WordPress Shortcode Template OOP with Style and Scrip
<?php
/*
*
*
*
*
*/
class Name__Class {
@JRyven
JRyven / style.css
Last active April 6, 2021 14:29
Styled Selector with just CSS
// CSS
div.select {
position: relative;
display: block;
width: 100%;
margin-bottom: 1rem;
border: 1px solid lightgrey;
border-radius: 10px;
}
@JRyven
JRyven / functions.php
Last active February 25, 2021 15:16
Generate 301 Redirects for and remove Taxonomy Terms
<?php
function redirect_builder(){
// CLEAN UP TAGS
// GATHER TAGS
$product_tag = 'product_tag';
$tags = get_terms( array(
'taxonomy' => $product_tag,
@JRyven
JRyven / site__content__popup.php
Last active February 25, 2021 15:10
Simple, cookied popup
<?php
/*
*
*
*
*
*/
class Popup__Elm {