Skip to content

Instantly share code, notes, and snippets.

Ryan R. Bayne RyanBayne

Block or report user

Report or block RyanBayne

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@RyanBayne
RyanBayne / gist:abcc5a0a369a4352080990527974c4a5
Last active Dec 15, 2018
TwitchPress Shortcode Template
View gist:abcc5a0a369a4352080990527974c4a5
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 Jul 3, 2017
PHP class for WordPress adds notices to the login form page. See working example in my TwitchPress Login Extension for the TwitchPress plugin.
View class.wordpress-login-notices.php
<?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 Jun 28, 2017
WordPress "Current URL" Re-builder - Adds new parameters and nonce.
View gist:eb5c5015e4ca72ab66fedde4b1d811be
/**
* 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(
View gist:bc1802c1c0aa8620fe43b9a53f1114f6
<?php
/**
* CLASS DESCRIPTION
*
* @author Ryan Bayne
* @category Admin
* @package Multitool/Admin
* @version 1.0
*/
View Multitool Settings Section Template
array(
'title' => __( 'SECTIONTITLE', 'multitool' ),
'type' => 'title',
'desc' => 'SECTIONDESCRIPTION',
'id' => 'SECTIONID',
),
array(
'title' => __( 'GROUPTITLE', 'multitool' ),
'desc' => __( 'INPUTDESCRIPTION.', 'multitool' ),
@RyanBayne
RyanBayne / 0_reuse_code.js
Created Mar 3, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View wordpress-new-file-example.php
<?php
/**
* PROJECTNAME - FILE NAME
*
* FILE PURPOSE EXPLAINED
*
* @author FIRSTNAME SECONDNAME
* @category SYSTEMCATEGORY
* @package PROJECT/SYSTEMCATEGORY
* @since 1.0.0
You can’t perform that action at this time.