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
@GaryJones
GaryJones / big-brother.php
Created October 2, 2014 10:31
Big Brother eviction of @tarendai's Davina swear.
<?php
// Solution for https://github.com/Tarendai/davina
/**
* Remove filter or action method added from an unassigned object.
*
* Solves the immediate case. Not bothered to generalise it.
*
* @global array $wp_filter Storage for all of the filters and actions.
<?php
/*
Handles URL Rewriting in WordPress 3.0 like this:
fastigheter-spanien/X -> property/X&lang=sv
fastigheter-usa/X -> property/X&lang=sv
properties-spain/X -> property/X&lang=en
properties-usa/X -> property/X&lang=en
@janfabry
janfabry / resize-img-tags.php
Created November 13, 2010 16:04
WordPress Resize img tags plugin (first public attempt)
<?php
/*
Plugin Name: Resize img tags
Plugin URI: http://www.monkeyman.be
Description: Change image src's based on width and height specified in tag
Version: 0.1
Author: Jan Fabry
This plugin rewrites <img> tags so that the src contains width and height information. It is supposed to be used together with a plugin that can generate these resized images on the fly, like monkeyman-on-demand-resizer.
@hakre
hakre / theme-napkin.php
Created February 8, 2011 15:32
Theme Napkin Wordpress Plugin - Safeguard unintended output generated by theme bootstrap code (functions.php).
<?php
/**
* Theme Napkin Wordpress Plugin
*
* Safeguard unintended output generated by theme bootstrap code (functions.php).
*
* Copyright 2011 by hakre <http::/hakre.wordpress.com>, some rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@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
@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:
*
@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
*/
@derpixler
derpixler / register_custom_post_types.php
Created January 25, 2012 16:03
register_custom_post_types
<?php
/**
* Meine Dokumentation zu der Funktion xyz die dafuer sorgt das XYZ etwas macht
*
* @autor Rene Reimann
* @package Theme XYZ
*/
if ( ! class_exists( 'register_custom_post_types' ) ) {
@kovshenin
kovshenin / options.php
Created April 23, 2012 12:12
Reusable Settings API fields
<?php
/**
* Text Field
*
* A simple text field callback to use with the Settings API. Don't forget to pass in
* the arguments array. Here's an example call to add_settings_field() :
*
* add_settings_field( 'my_option', __( 'My Option' ), 'foo_field_text', 'theme_options', 'general', array(
* 'name' => 'my_theme_options[my_option]',
* 'value' => $options['my_option'], // assuming $options is declared
@RalfAlbert
RalfAlbert / filters-for-simple-cache-template.php
Created June 7, 2012 23:53
Page template for WordPress with caching
<?php
add_action( 'save_post', 'clear_many_sites_transient', 10, 1 );
add_action( 'edit_post', 'clear_many_sites_transient', 10, 1 );
function clear_many_sites_transient( $post_id ){
$post = get_post( $post_id );
if( 'page' === $post->post_type )
delete_transient( 'many_sites_in_one' );