Skip to content

Instantly share code, notes, and snippets.

View SmashBrando's full-sized avatar

Brandon Kidd SmashBrando

  • Fort Collins, Colorado
View GitHub Profile
@SmashBrando
SmashBrando / shortcodes.js
Created May 12, 2014 20:34
WordPress Shortcode Buttons (icons not included 20*20)
jQuery(document).ready(function($) {
// 1. Youtube Shortcode
tinymce.create('tinymce.plugins.youtube_plugin', {
init : function(ed, url) {
// Register command for when button is clicked
ed.addCommand('youtube_insert_shortcode', function() {
selected = tinyMCE.activeEditor.selection.getContent();
if( selected ){
@SmashBrando
SmashBrando / loginredirect.html
Last active May 26, 2022 14:46
BigCommerce Login Redirect
<!-- place this snipet in HTMLhead.html, replace yourdomain with the url of your login page -->
<script>
$(document).ready(function(){
if(
($('#LoginOrLogoutText > div > a:contains("Sign in")').length > 0) && (window.location.href.indexOf("login") === -1)
){
window.location.assign("//www.yourdomain.com/login.php");
}
});
</script>
@SmashBrando
SmashBrando / flex-bs-pricing.php
Last active November 12, 2019 04:18
Bootstrap Price Table | Advanced Custom Fields | Flexible Content | Repeater | Comma Separated Features
<?php
// check if the flexible content field has rows of data
if( have_rows('flexible_content') ):
// loop through the rows of data
while ( have_rows('flexible_content') ) : the_row();
//check current row layout
if( get_row_layout() == 'pricing' ):
@SmashBrando
SmashBrando / gist:f00a4a9088914c95f71d
Created September 23, 2014 18:57
Gravity Forms ACF5 issue
.block.sidebar {
display: table;
}
.block .sidebar {
background-color: #e3e6eb;
display: table-cell;
vertical-align: middle;
}
<div class="ghostDropBlock">
<span>Drop here to target this display option with this audience segment.</span>
</div>
@SmashBrando
SmashBrando / functions.php
Last active February 5, 2020 16:27
Google Trusted Stores - Woocommerce Thank You Page Output
<?php
add_action( 'woocommerce_thankyou', 'google_trusted_stores_confirmation' );
function google_trusted_stores_confirmation( $order_id ) {
// Lets grab the order
$order = wc_get_order( $order_id );
$customer = get_current_user_id();
@SmashBrando
SmashBrando / HierarchicalDataTemplate.aspx
Created August 13, 2021 15:35
HierarchicalDataTemplate
<HierarchicalDataTemplate x:Key="
CheckBoxTreeViewItemTemplate"
ItemsSource="{Binding Items, Mode=OneWay}" >
<StackPanel Orientation="Horizontal">
<Image Margin="2,0" Source="{Binding ImageSource, Mode=TwoWay}" />
<CheckBox Focusable="False" IsChecked="{Binding IsChecked}" VerticalAlignment="Center"/>
<ContentPresenter Content="{Binding Text, Mode=TwoWay}" Margin="2,0" />
</StackPanel>
</HierarchicalDataTemplate>
@SmashBrando
SmashBrando / CheckedTreeViewItem.cs
Created August 13, 2021 15:43
CheckedTreeViewItem
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Controls;
public class CheckedTreeViewItem : ItemsControl, INotifyPropertyChanged
{
bool? _isChecked = false;