Skip to content

Instantly share code, notes, and snippets.

View kcpt-steven-kohlmeyer's full-sized avatar

Steven Kohlmeyer kcpt-steven-kohlmeyer

  • Kansas City Public Television
  • Kansas City, Mo
View GitHub Profile
@kcpt-steven-kohlmeyer
kcpt-steven-kohlmeyer / deploy.sh
Created October 4, 2016 18:24 — forked from kjohnson/deploy.sh
Ninja Forms deploy script
#!/bin/sh
# By Mike Jolley, based on work by Barry Kooij ;)
# License: GPL v3
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@kcpt-steven-kohlmeyer
kcpt-steven-kohlmeyer / query-hooks.php
Created February 9, 2015 22:51
Virtual URLs to modify query
<?php
function add_custom_query_vars($vars) {
$vars[] = "past_events";
return $vars;
}
// hook add_query_vars function into query_vars
add_filter('query_vars', 'add_custom_query_vars');
@kcpt-steven-kohlmeyer
kcpt-steven-kohlmeyer / custom-pretty-url-rewrite.php
Created February 9, 2015 22:48
Wordpress script to create custom pretty urls, and set query variables for filtering
<?php
function customQueryVar($vars) {
$vars[] = "year_filter";
return $vars;
}
// hook add_query_vars function into query_vars
add_filter('query_vars', 'customQueryVar');
<?php
function add_custom_query_vars($vars) {
$vars[] = "sociallogin";
return $vars;
}
// hook add_query_vars function into query_vars
add_filter('query_vars', 'add_custom_query_vars');
@kcpt-steven-kohlmeyer
kcpt-steven-kohlmeyer / redirect-subscriber.php
Created February 9, 2015 21:25
Wordpress: Redirect subscribers from accessing admin.
<?php
global $current_user; // Use global
get_currentuserinfo(); // Make sure global is set, if not set it.
if ( user_can( $current_user, "subscriber" ) ) {
// Disable admin bar for subscribers
show_admin_bar(false);