Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
Working from home

David Chandra Purnama turtlepod

🎧
Working from home
View GitHub Profile
@turtlepod
turtlepod / gtoc.php
Created Jul 28, 2012
Genbu Table Of Content Shortcode
View gtoc.php
<?php
/*
* 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
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Based on (credit) :
* WP TOC by Brendon Boshell http://infinity-infinity.com/
@turtlepod
turtlepod / unplugged-plugin.php
Created Nov 29, 2012 — forked from rachelbaker/unplugged-plugin.php
Load a different WordPress theme for mobile visitors
View unplugged-plugin.php
<?php
/*
Plugin Name: Unplugged Mobile Theme
Plugin URI: http://www.rachelbaker.me
Description: A plugin and theme for WordPress that automatically reformats your blog's content for optimized viewing on Apple's <a href="http://www.apple.com/unplugged/">unplugged</a> and <a href="http://www.apple.com/ipodtouch/">iPod touch</a>.
Author: Rachel Baker
Version: 0.1
Author URI: http://www.rachelbaker.me
# Special thanks to Imthiaz Rafiq and the wp-pda Plugin (http://imthi.com/wp-pda/) which this plugin is derived from.
View wp-editor-bug.css
.wp-audio-shortcode {
max-width:100%;
margin-bottom: 20px;
}
@turtlepod
turtlepod / gist:5114385
Created Mar 8, 2013
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
View gist:5114385
<?php
/**
* 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
turtlepod / gist:5250802
Created Mar 27, 2013
my debug mu-plugin. only use this on localhost.
View gist:5250802
<?php
/**
* Plugin Name: Debug-ing
* Plugin URI: http://shellcreeper.com/
* Description: just for debug on localhost.
* Version: 0.1.0
* Author: David Chandra Purnama
* Author URI: http://shellcreeper.com/
*/
@turtlepod
turtlepod / gist:5343584
Last active Dec 15, 2015
Debug: Metabox order and hidden metabox
View gist:5343584
<?php
/* data to display */
function capsule_print_data(){
global $current_user;
# Metabox Order
$meta_box_order = get_user_meta(
wp_get_current_user()->ID
,sprintf( 'meta-box-order_%s', 'post' )
,true
@turtlepod
turtlepod / gist:5343672
Last active Dec 15, 2015
Example to filter editor style json style_formats
View gist:5343672
<?php
function capsule_print_data2(){
/* style dropdown */
$settings = array();
$style_formats = array(
array(
'title' => 'Code',
'inline' => 'code',
),
@turtlepod
turtlepod / gist:5378353
Created Apr 13, 2013
Shell Editor CSS custom markup. Need to remove this from shell somehow....
View gist:5378353
/**
* Shell Content Editor CSS
* =========================
*/
/* Note */
.note {
padding: 6px 9px;
background: #eee;
border: 1px solid #ccc;
@turtlepod
turtlepod / gist:5921837
Created Jul 3, 2013
Hybrid Base functions.php with link to Docs
View gist:5921837
<?php
/**
* 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
turtlepod / meta-box-class.php
Last active Dec 27, 2015
Simple Meta Box Helper Class
View meta-box-class.php
<?php
/* Prevent loading this file directly and/or if the class is already defined */
if ( ! defined( 'ABSPATH' ) || class_exists( 'SC_Plugin_Meta_Box_Class' ) )
return;
/**
* 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.