Skip to content

Instantly share code, notes, and snippets.

View michael-cannon's full-sized avatar

Michael Cannon michael-cannon

View GitHub Profile
<?php
/**
* @Author Anonymous
* @link http://www.redrokk.com
* @Package Wordpress
* @SubPackage RedRokk Library
*
* @version 2.0
*/
@pixline
pixline / osxlocal.sh
Last active December 24, 2015 08:39
homebrew local setup
#!/bin/bash
homebrew_packages=(
freetype
jpeg
libpng
gd
zlib
openssl
unixodbc
@alienlebarge
alienlebarge / bootstrap-navbar.ts
Last active October 6, 2015 13:48
Typoscript config for twitter bootstrap navbar
#####################################################################
# [Navbar]
lib.field_navbar = COA
lib.field_navbar {
wrap = <div class="navbar navbar-fixed-top"><div class="navbar-inner"><div class="container">|</div></div></div>
# collapse button
10 = COA
@franz-josef-kaiser
franz-josef-kaiser / example_post_status.php
Created June 14, 2012 13:07
Add a custom post status for WP (custom) post types
<?php
// No, Thanks. Direct file access forbidden.
! defined( 'ABSPATH' ) AND exit;
// INIT
add_action( 'after_setup_theme', array( 'unavailable_post_status', 'init' ) );
class unavailable_post_status extends wp_custom_post_status
{
/**
@clarklab
clarklab / wp_insert_post_front_end_form.php
Created May 25, 2012 00:12
This is a sample front-end form using wp_insert_post(). It's quickly stripped out of my production code from Android and Me, and hasn't been tested alone, so please take it with a grain of salt.
<?
if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['insert_post'] )) { //check that our form was submitted
$title = $_POST['thread_title']; //set our title
if ($_POST['thread_description']=="") { // check if a description was entered
$description = "See thread title..."; // if not, use placeholder
} else {
$description = $_POST['thread_description']; //if so, use it
@jonathonbyrdziak
jonathonbyrdziak / example.php
Created February 22, 2012 02:27
Wordpress Metabox, stand alone class for multiple metabox abilities
<?php
/*
Here's a couple of metaboxes that I've recently created using this system
*/
$subpostings = redrokk_metabox_class::getInstance('subpostings', array(
'title' => '(optional) Subscription for Postings',
'description' => "As an optional feature, you have a complete api at your disposal which will allow you the ability to offer and manage member posts. In addition to these settings, you may need to create the associated pages for accepting posts from your frontend.",