Skip to content

Instantly share code, notes, and snippets.

View turtlepod's full-sized avatar
Working from home

David Chandra Purnama turtlepod

Working from home
View GitHub Profile
turtlepod / gtoc.php
Created July 28, 2012 09:46
Genbu Table Of Content Shortcode
* Genbu Table Of Content Shortcode
* use [gtoc] to generate shortcode
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* Based on (credit) :
* WP TOC by Brendon Boshell
turtlepod / unplugged-plugin.php
Created November 29, 2012 17:37 — forked from rachelbaker/unplugged-plugin.php
Load a different WordPress theme for mobile visitors
Plugin Name: Unplugged Mobile Theme
Plugin URI:
Description: A plugin and theme for WordPress that automatically reformats your blog's content for optimized viewing on Apple's <a href="">unplugged</a> and <a href="">iPod touch</a>.
Author: Rachel Baker
Version: 0.1
Author URI:
# Special thanks to Imthiaz Rafiq and the wp-pda Plugin ( which this plugin is derived from.
.wp-audio-shortcode {
margin-bottom: 20px;
turtlepod / gist:5114385
Created March 8, 2013 05:25
Better Hybrid Core Theme Settings, with column options. CSS won't work. cause the div's change. this just following HTML in post edit screen
* Handles the display and functionality of the theme settings page. This provides the needed hooks and
* meta box calls for developers to create any number of theme settings needed. This file is only loaded if
* the theme supports the 'hybrid-core-theme-settings' feature.
* Provides the ability for developers to add custom meta boxes to the theme settings page by using the
* add_meta_box() function. Developers should register their meta boxes on the 'add_meta_boxes' hook
* and register the meta box for 'appearance_page_theme-settings'. To validate/sanitize data from
* custom settings, devs should use the 'sanitize_option_{$prefix}_theme_settings' filter hook.
turtlepod / gist:5250802
Created March 27, 2013 01:21
my debug mu-plugin. only use this on localhost.
* Plugin Name: Debug-ing
* Plugin URI:
* Description: just for debug on localhost.
* Version: 0.1.0
* Author: David Chandra Purnama
* Author URI:
turtlepod / gist:5343584
Last active December 15, 2015 23:50
Debug: Metabox order and hidden metabox
/* data to display */
function capsule_print_data(){
global $current_user;
# Metabox Order
$meta_box_order = get_user_meta(
,sprintf( 'meta-box-order_%s', 'post' )
turtlepod / gist:5343672
Last active December 15, 2015 23:58
Example to filter editor style json style_formats
function capsule_print_data2(){
/* style dropdown */
$settings = array();
$style_formats = array(
'title' => 'Code',
'inline' => 'code',
turtlepod / gist:5378353
Created April 13, 2013 13:13
Shell Editor CSS custom markup. Need to remove this from shell somehow....
* Shell Content Editor CSS
* =========================
/* Note */
.note {
padding: 6px 9px;
background: #eee;
border: 1px solid #ccc;
turtlepod / gist:5921837
Created July 3, 2013 19:15
Hybrid Base functions.php with link to Docs
* The functions file is used to initialize everything in the theme. It controls how the theme is loaded and
* sets up the supported features, default actions, and default filters. If making customizations, users
* should create a child theme and make changes to its functions.php file (not this one). Friends don't let
* friends modify parent theme files. ;)
* Child themes should do their setup on the 'after_setup_theme' hook with a priority of 11 if they want to
* override parent theme features. Use a priority of 9 if wanting to run before the parent theme.
turtlepod / meta-box-class.php
Last active December 27, 2015 15:39
Simple Meta Box Helper Class
/* Prevent loading this file directly and/or if the class is already defined */
if ( ! defined( 'ABSPATH' ) || class_exists( 'SC_Plugin_Meta_Box_Class' ) )
* Shellcreeper Meta Boxes Class
* Helper class to easily create meta boxes in post edit screen with Meta Box API.
* Rename this class name if you use it in your plugin/theme.