Skip to content

Instantly share code, notes, and snippets.

View bueltge's full-sized avatar
Always interested

Frank Bültge bueltge

Always interested
View GitHub Profile
@bueltge
bueltge / gist:998531
Created May 30, 2011 07:00
Example for add a Custom Post Type to the WordPress Post Feed
add_action( 'request', array( &$this, 'add_to_feed' ) );
// add to post-feed
function add_to_feed($request) {
if ( isset($request['feed']) && !isset($request['post_type']) ) {
$request['post_type'] = get_post_types( $args = array(
'public' => true,
'capability_type' => 'post'
) );
@franz-josef-kaiser
franz-josef-kaiser / script_deamon.php
Created June 10, 2011 15:59
WordPress Plugin to check your DataBase for injected links
<?php
/**
Plugin Name: AntiScript deamon
Plugin URI: https://github.com/franz-josef-kaiser
Description: Removes script-links to spam sites from your post content after your site got hacked. Please go to <a href="tools.php?page=script_deamon.php">Tools &rarr; Remove Hack</a>. Thank you. Proudly brought to you by <a href="http://example.com">Franz Josef Kaiser</a>.
Version: 0.1
Author: Franz Josef Kaiser
Author URI: https://github.com/franz-josef-kaiser
License: GPL2
WP-Version: Tested in 2.7.1, 2.9.2, 3.0
@franz-josef-kaiser
franz-josef-kaiser / _debug.php
Created June 23, 2011 15:52
WordPress debug plugin
<?php
/*
Plugin Name Easy Debug function
Plugin URI https://gist.github.com/1042827
Description Allows the use of <code>_dump( $example_var );</code> or <code>_dump( 'example_global' );</code> for debugging variables. Collects everything in a global & prints in the footer (admin & public). If you want to not print, just return, then set <code>$hook</code> to <code>false</code> when calling the function.
Author Franz Josef Kaiser
Author URI https://github.com/franz-josef-kaiser
Version 0.1
Options Version 0.1
License MIT Extended
@markjaquith
markjaquith / disable-plugins-when-doing-local-dev.php
Created June 24, 2011 10:24
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@bentruyman
bentruyman / Custom.css
Created August 17, 2011 00:30
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@scribu
scribu / wrapping.php
Last active January 7, 2024 11:59
Theme wrapping
<?php
# License: Public Domain
# I recommend replacing 'my_' with your own prefix.
function my_template_path() {
return My_Wrapping::$main_template;
}
@ocean90
ocean90 / class-wordpress-breadcrumb.php
Created September 18, 2011 19:04
Breadcrumb Navigation for WordPress
<?php
/**
* Klasse zum Erstellen einer WordPress Breadcrumb Navigation.
*
* @author Dominik Schilling
* @license GPLv2
* @link http://wpgrafie.de/204/
*
* @version 0.1.1
*/
@mikeschinkel
mikeschinkel / TCB_JSON_API.php
Created November 2, 2011 16:44
Creates JSON class for Tom C. Barret to load tickets via a RESTful API
<?php
/**
* Creates JSON class for Tom C. Barrett to load tickets via a RESTful API:
*
* @example:
*
* URL: http://example.com/api/ticket/12345
*
* @see:
*
@mikeschinkel
mikeschinkel / parks-and-features.php
Created November 5, 2011 23:16
Plugin demonstrates how to route parent post/child post URLs WordPress 3.3
<?php
/**
* Plugin Name: MMC Parks and Features
* Description: This plugin demonstrates how to route parent/child URLs like http://example.com/parks/yosemite/half-dome/in WordPress 3.3
* Author: Mike Schinkel
* Author URL: http://about.me/mikeschinkel
* Notes:
* To answer http://lists.automattic.com/pipermail/wp-hackers/2011-November/041486.html
* Assumes a metabox that sets $post->post_parent field for a park feature with it's park's $post->ID.
*
@RalfAlbert
RalfAlbert / testplugin.php
Created November 17, 2011 21:31
A very (very, very) simple unittest for WordPress
<?php
/*
Plugin Name: WordPressTests
Plugin URI:
Description: Automated testing of WordPress
Version: 0.0.1-dev01
Author: Ralf Albert
Author URI: http://yoda.neun12.de
*/