Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Searching for talents

Frank Bültge bueltge

:octocat:
Searching for talents
View GitHub Profile
@bueltge
bueltge / class-taxonomy-helper.php
Created Oct 10, 2011
Helper Class To Add Custom Taxonomy To Post Permalinks
View class-taxonomy-helper.php
/**
* A helper class for registering and handling a custom rewrite tag for a custom taxonomy.
*
* @version 1.0.0
*/
class Add_Taxonomy_To_Post_Permalinks {
/**
* Stores the taxonomy slug that this class will be handling. Don't edit this.
*
@bueltge
bueltge / gist:1292097
Created Oct 17, 2011
Update User Data in WordPress, depending from domain
View gist:1292097
-- generic email addresses and new passwords for users
UPDATE wp_users
SET user_email = CONCAT(user_login, '@example.com'),
user_pass = MD5(CONCAT(RAND(), CAST(ID AS CHAR), user_login));
-- generic email addresses for commentors
UPDATE wp_comments
SET comment_author_email = CONCAT(CAST(comment_ID AS CHAR), '@example.com');
@bueltge
bueltge / script_deamon.php
Created Nov 13, 2011 — forked from franz-josef-kaiser/script_deamon.php
WordPress Plugin to check your DataBase for injected links
View script_deamon.php
<?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
@bueltge
bueltge / gist:1362660
Created Nov 13, 2011
Extract word from a string given a position in php
View gist:1362660
function extractWord($text, $position){
$words = explode(' ', $text);
$characters = -1;
foreach($words as $word){
$characters += strlen($word);
if($characters >= $position){
return $word;
}
}
return '';
@bueltge
bueltge / restrict-mime-types.php
Created Dec 15, 2011
Restrict list of allowed mime types and file extensions.
View restrict-mime-types.php
<?php
/**
* Plugin Name: Restrict mime types
* Plugin URI: http://wpengineer.com/?p=2369
* Description: Restrict list of allowed mime types and file extensions.
* Version: 1.0.0
* License: GPLv3
* Author: Frank B&uuml;ltge
* Author URI: http://bueltge.de/
*/
@bueltge
bueltge / gist:1503172
Last active Sep 28, 2015
Remove Admin Bar in WordPress 3.3
View gist:1503172
<?php
/**
* Plugin Name: Remove Admin Bar in WordPress 3.3
* Plugin URI: http://wordpress.stackexchange.com/questions/40983/removing-admin-bar-from-wordpress-dashboard
* Description: Remove Admin Bar
* Version: 1.0.0
* Author: Frank Bültge
* Author URI: http://bueltge.de
* License: GPLv3
*/
@bueltge
bueltge / gist:1559312
Created Jan 4, 2012
Inputfelder optional zwischen type=text|password umschaltbar
View gist:1559312
<form method="post" action="">
<input type="password" id="my_password" name="password" value="" autocomplete="off" />
<input type="submit" value="Los" id="my_submit" disabled="disabled" onclick="document.getElementById('my_password').type = 'password'" />
<br />
<input type="checkbox" onchange="document.getElementById('my_password').type = this.checked ? 'text' : 'password';"> Passwort beim Tippen anzeigen
</form>
View gist:1572371
on this source; Aptana dont view functions, vars etc. in outline window
if ( ! class_exists( 'Foo' ) ) {
class Foo {
static public $foo;
public function foo() {
@bueltge
bueltge / gist:1575381
Created Jan 7, 2012
Remove pixel in img for responsive design
View gist:1575381
// remove height, width for responsive design
(function ($) {
$(document).ready(function($) {
$( 'img' ).removeAttr( 'height' ).removeAttr( 'width' );
});
})(jQuery);
View normalize.css
/**
* @package Normalize Style with goal CSS3 and html5-elements
* @author Hans Mustermann <info@inpsyde.com>
* @since 0.0.1
* @version 0.0.2
*
* Description: Normalize all browsers
*
* Normalize, inspired by http://bueltge.de/b/33 and http://bueltge.de/b/34
*/
You can’t perform that action at this time.