Skip to content

Instantly share code, notes, and snippets.

View RyanBayne's full-sized avatar
🏠
Working from home

Ryan R. Bayne RyanBayne

🏠
Working from home
View GitHub Profile
@RyanBayne
RyanBayne / gist:abcc5a0a369a4352080990527974c4a5
Last active December 15, 2018 20:58
TwitchPress Shortcode Template
function twitchpress_SHORTCODE_NAME_shortcode( $atts ) {
$html_output = '';
$atts = shortcode_atts( array(
'PARAM' => VALUE,
), $atts, 'twitchpress_SHORTCODE_NAME' );
$transient_code = $atts['PARAM'];
if( $cache = get_transient( 'twitchpress_SHORTCODE_NAME' . $transient_code ) ) {
@RyanBayne
RyanBayne / class.wordpress-login-notices.php
Created July 3, 2017 22:33
PHP class for WordPress adds notices to the login form page. See working example in my TwitchPress Login Extension for the TwitchPress plugin.
<?php
/**
* WordPress custom login form notices class.
*
* Originally designed for TwitchPress systems by Ryan Bayne.
*
* @author Ryan Bayne
* @category User Interface
* @package TwitchPress Login Extension
* @since 1.0.0
@RyanBayne
RyanBayne / gist:eb5c5015e4ca72ab66fedde4b1d811be
Last active June 28, 2017 15:11
WordPress "Current URL" Re-builder - Adds new parameters and nonce.
/**
* Create a nonced URL for returning to the current page.
*
* @param mixed $new_parameters_array
*
* @version 1.0
*/
function url_rebuilder_nonced( $new_parameters_array, $action, $specified_url = null ) {
return esc_url(
wp_nonce_url(
@RyanBayne
RyanBayne / gist:bc1802c1c0aa8620fe43b9a53f1114f6
Created June 15, 2017 21:08
Multitool Class File Template
<?php
/**
* CLASS DESCRIPTION
*
* @author Ryan Bayne
* @category Admin
* @package Multitool/Admin
* @version 1.0
*/
array(
'title' => __( 'SECTIONTITLE', 'multitool' ),
'type' => 'title',
'desc' => 'SECTIONDESCRIPTION',
'id' => 'SECTIONID',
),
array(
'title' => __( 'GROUPTITLE', 'multitool' ),
'desc' => __( 'INPUTDESCRIPTION.', 'multitool' ),
@RyanBayne
RyanBayne / 0_reuse_code.js
Created March 3, 2017 13:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@RyanBayne
RyanBayne / wordpress-new-file-example.php
Last active March 3, 2017 12:27
WordPress New File Header
<?php
/**
* PROJECTNAME - FILE NAME
*
* FILE PURPOSE EXPLAINED
*
* @author FIRSTNAME SECONDNAME
* @category SYSTEMCATEGORY
* @package PROJECT/SYSTEMCATEGORY
* @since 1.0.0