Skip to content

Instantly share code, notes, and snippets.

View JRyven's full-sized avatar

James Ryven Valeii JRyven

View GitHub Profile
@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 / functions.php
Created April 20, 2021 09:12
WordPress Shortcode Template OOP with Style and Scrip
<?php
/*
*
*
*
*
*/
class Name__Class {
@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 {
@JRyven
JRyven / oop-html-builder.php
Last active September 30, 2020 08:33
OOP PHP HTML Builder
<?php
/* https://stackoverflow.com/questions/3488373/php-class-to-generate-html#answer-62349439 */
/**
* HTML - Simplest html element builder
* - @param1 Element name
* - @param2 Class name
* - @param3 ID
* - @param2 Element content
*/
class HTML{
@JRyven
JRyven / site__function__jquery_set_unavailable_available_and_weekly_date_options.js
Last active August 15, 2020 11:16
jQuery Datepicker set Unavailable, Available, Weekly date options
<script>
// set unavailable dates
var unavailableDates = ['26-11-2020','24-12-2020','25-12-2020'];
var availableDates = ['9-9-2020','25-11-2020'];
// check unavailable dates and verify if the weekday is approved
function unavailable(date) {
// beforeShowDay, get date
<?php
function populate_csv( $entry, $form ) {
/* remove some questions from the output via label filtering */
$exclusions = array(
'Field Name One',
'Field Name Two',
'Field Name Three',
);