This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// archiveboard.php (companion to cpt-board.php) | |
// by Greg Schoppe (http://gschoppe.com) | |
// Licensed under GPL | |
// Renders archive page for board of directors custom post type | |
// Will need to be customized to match theme. This one is customized for the _TK bootstrap theme | |
get_header(); ?> | |
<?php // add the class "panel" below here to wrap the content-padder in Bootstrap style ;) ?> | |
<div class="content-padder"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
usort($array, function($a, $b) { | |
// explode name a by spaces | |
$parts_a = explode(' ', $a); | |
// remove the last name from the end of the array | |
$last_a = array_pop($parts_a); | |
// and shove it on the front | |
array_unshift($parts_a, $last_a); | |
// then re-implode into a string | |
$a = implode(' ', $parts_a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// PHP Minimal Filesystem Function Cache | |
// by Greg Schoppe (http://gschoppe.com) | |
// copyright 2015 Greg Schoppe, GPL, BSD, and MIT licensed | |
// takes a function name as a string, and an array of the arguments to be passed to that function | |
// caches and returns the results of that function call (or the cached copy, if less than $TTL seconds old) | |
// Useful for rate-limiting cURL requests, or other high resource or rate limited functions | |
// WARNING: DO NOT USE WITH ANONYMOUS FUNCTIONS (AKA: CLOSURES), ANY FUNCTION THAT PRODUCES SIDE EFFECTS, | |
// OR WITH ANY FUNCTION THAT DOES NOT RETURN A SERIALIZABLE VALUE | |
function callFunctionWithCache($functionName, $arguments = array(), $TTL=3600, $purgeCache=false) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Event taxonomies | |
add_action( 'init', function() { | |
$labels = array( | |
'name' => _x( 'Terms', 'taxonomy general name' ), | |
'singular_name' => _x( 'Term', 'taxonomy singular name' ), | |
); | |
register_taxonomy( 'taxonomy_name', array( 'post' ), array( | |
'hierarchical' => false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if( !defined( 'ABSPATH' ) ) { die(); } // Include in all php files, to prevent direct execution | |
/** | |
* Class Name : WP Persistent Notices | |
* Description : Implements a Standardized messaging system that allows admin messages to be passed across page redirects. | |
* Class URI : http://gschoppe.com/wordpress/pass-wordpress-admin-notices-across-page-redirects/ | |
* Version : 1.0.0 | |
* Author : Greg Schoppe | |
* Author URI : http://gschoppe.com | |
* License: GPL-2.0+ | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if(!defined('ABSPATH')) { die(); } // Include in all php files, to prevent direct execution | |
if( !class_exists('SpeedUpBulkEdit') ) { | |
class SpeedUpBulkEdit { | |
private static $_this; | |
private $is_bulk = false; | |
public static function Instance() { | |
static $instance = null; | |
if ($instance === null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /* place in functions.php or in a custom plugin */ | |
// Add Blockade to the custom post types "foo" and "bar" | |
add_filter('wp-blockade-override-post-types', 'add_my_blockade_post_types'); | |
function add_my_blockade_post_types( $post_types ) { | |
$post_types[] = "foo"; | |
$post_types[] = "bar"; | |
return $post_types; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /* place in functions.php */ | |
add_action( 'after_setup_theme', 'my_theme_setup' ); | |
function my_theme_setup() { | |
add_editor_style(); // We recommend using an editor-style.css file , that includes all the styles that will apply to the content | |
add_theme_support( 'wp-blockade' ); // This tells Blockade that your theme includes Bootstrap | |
// add_theme_support( 'bootstrap', '3.3.7' ); // alternatively, you can just register bootstrap support, along with your version number | |
$palette = array( // set the colors available in the editor's colorpickers | |
'Primary' => '#811381', | |
'Black' => '#000000', | |
'White' => '#FFFFFF', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Hide shortcodes in excerpts or if rendering fails | |
* Usage: <!--[shortcode-name comment-wrapped=true]--> | |
*/ | |
add_filter( 'do_shortcode_tag', "comment_wrap_shortcodes", 10, 3 ); | |
function comment_wrap_shortcodes( $output, $tag, $atts ) { | |
$args = shortcode_atts( array( | |
'comment-wrapped' => 'false' | |
), $atts ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if(!defined('ABSPATH')) { die(); } // Include in all php files, to prevent direct execution | |
/** | |
* Plugin Name: Better Auto Excerpts | |
* Plugin URI: | |
* Description: replaces block-level elements with whitespace, to improve the_excerpt | |
* Version: 1.0.0 | |
* Author: Burlington Bytes | |
* Author URI: https://www.burlingtonbytes.com | |
* Text Domain: better-auto-excerpts | |
* License: GPL-2.0+ |
OlderNewer