Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Cannon michael-cannon

View GitHub Profile
View class-redrokk-metabox-class.php
<?php
/**
* @Author Anonymous
* @link http://www.redrokk.com
* @Package Wordpress
* @SubPackage RedRokk Library
*
* @version 2.0
*/
@pixline
pixline / osxlocal.sh
Last active Dec 24, 2015
homebrew local setup
View osxlocal.sh
#!/bin/bash
homebrew_packages=(
freetype
jpeg
libpng
gd
zlib
openssl
unixodbc
@alienlebarge
alienlebarge / bootstrap-navbar.ts
Last active Oct 6, 2015
Typoscript config for twitter bootstrap navbar
View bootstrap-navbar.ts
#####################################################################
# [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 Jun 14, 2012
Add a custom post status for WP (custom) post types
View example_post_status.php
<?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
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.
View wp_insert_post_front_end_form.php
<?
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 Feb 22, 2012
Wordpress Metabox, stand alone class for multiple metabox abilities
View example.php
<?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.",