Skip to content

Instantly share code, notes, and snippets.

View mikeselander's full-sized avatar
:shipit:
Shipping

Mike Selander mikeselander

:shipit:
Shipping
View GitHub Profile
@mikeselander
mikeselander / the_content_filter.php
Created October 28, 2014 22:32
using the_content filter
$content = 'My Content';
echo apply_filters( 'the_content', content );
@mikeselander
mikeselander / state_arrays.php
Created October 27, 2014 19:01
State Arrays
$state_array = array(
'Alabama' => "Alabama",
'Alaska' => "Alaska",
'Arizona' => "Arizona",
'Arkansas' => "Arkansas",
'California' => "California",
'Colorado' => "Colorado",
'Connecticut' => "Connecticut",
'Delaware' => "Delaware",
'Florida' => "Florida",
<?php
function check_user_role($roles,$user_id=NULL) {
// Get user by ID, else get current user
if ($user_id)
$user = get_userdata($user_id);
else
$user = wp_get_current_user();
// No user found, return
@mikeselander
mikeselander / browsers.css
Created September 29, 2014 17:22
Common Browser Specific Selectors
// ================ IE SPECIFIC SELECTORS
background: gray; /* standard */
//background: grey \0/; /* IE8+9 */
//\0/ - i.e. padding: 0px 5px 10px 70px\0/ /* IE 8 only */
background: pink\9; /* IE 9 and below */
@mikeselander
mikeselander / progress-bar.css
Created September 29, 2014 17:17
Progress Bar CSS
.progress-bar {
width: 95%;
height: 14px;
padding: 3px;
background-color: #ffffff;
overflow:hidden;
border-radius:16px;
box-shadow: inset 0 1px 2px #000,
0 1px 0 #2b2b2b;
float:right;
@mikeselander
mikeselander / triangle.less
Last active August 29, 2015 14:07
Simple Triangle CSS
&:after{
@size:32;
content:"";
position: absolute;
bottom: -@size*1px;
left: 0;
width: 0;
height: 0;
border-width:(@size / 2)*1px;
border-style:solid;
@mikeselander
mikeselander / new_gist_file_0
Created September 13, 2014 19:25
Sanitize Text (from Word in the first one) Word stuff from: http://www.paulund.co.uk/sanitize-special-word-characters
function sanitize_from_word( $content )
{
// Convert microsoft special characters
$replace = array(
"‘" => "'",
"’" => "'",
"”" => '"',
"“" => '"',
"–" => "-",
"—" => "-",
@mikeselander
mikeselander / breadcrumb.php
Created August 13, 2014 22:36
Nice, clean breadcrumb function
function otm_breadcrumb(){
global $post;
$trail = '';
$page_title = get_the_title($post->ID);
if($post->post_parent) {
$parent_id = $post->post_parent;
@mikeselander
mikeselander / content_by_id.php
Created August 8, 2014 17:39
Get content by id
$post = get_post( $id );
$content = apply_filters( 'the_content', $post->post_content );
echo $content;
@mikeselander
mikeselander / new_gist_file_0
Last active August 29, 2015 14:04
Tax Rates Master
FORT COLLINS; FT COLLINS; FT. COLLINS - 3.85
Larimer County - 0.65
80511; 80512; 80513; 80515; 80517; 80517; 80521; 80522; 80523; 80524; 80525; 80526; 80527; 80528; 80532; 80535; 80536; 80537; 80538; 80539; 80541; 80545; 80547; 80549; 80553
CO - 2.9