This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Singleton { | |
private static $_instances = array(); | |
final public static function getInstance() { | |
return ! isset( self::$_instances[ get_called_class() ] ) | |
? self::$_instances[ get_called_class() ] = new static | |
: self::$_instances[ get_called_class() ]; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function ( $ ) { | |
$( document ).keydown( function( e ) { | |
var url = false; | |
if ( 37 == e.which ) { // Left arrow key code | |
url = $( '.prev a' ).attr( 'href' ); // set right class | |
} | |
else if ( 39 == e.which ) { // Right arrow key code | |
url = $( '.next a' ).attr( 'href' ); // set right class | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Remove br in pre | |
* Plugin URI: http://wordpress.stackexchange.com/questions/39843/no-filter-of-code-on-switch-from-html-to-visual-editor-how | |
* Text Domain: | |
* Domain Path: /languages | |
* Description: | |
* Version: beta | |
* Author: Frank Bültge | |
* Author URI: http://bueltge.de |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a id="github" href="https://github.com/bueltge"> | |
<span>Fork me on GitHub!</span> | |
<span>Get free lemonade!</span> | |
</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Remove Gravatar on Admin Bar | |
* Plugin URI: http://talkpress.de/artikel/wordpress-admin-bar-datenkrake-missbrauch | |
* Description: Remove Gravatar on Admin Bar | |
* Version: 1.0.0 | |
* Author: Frank Bültge | |
* Author URI: http://bueltge.de | |
* License: GPLv3 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
body { | |
margin: 5em; | |
} | |
.tooltip { | |
font: normal 11px/17px sans-serif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* View and change on http://dabblet.com/gist/1787522 | |
*/ | |
body { | |
margin: 7em 3em; | |
} | |
button, | |
input, | |
select, | |
textarea { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Example of use: | |
$bl_check = new Fb_Backlink_Checker( 'http://www.example.com', 'http://other.com' ); | |
$bl_check->get_contents(); | |
$bl_check->fetch_links(); | |
if ( TRUE !== $bl_check->check() ) { | |
echo 'Backlink not found.'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'add_meta_boxes', 'do_my_meta_boxes' ); | |
function do_my_meta_boxes( $post_type ) { | |
remove_meta_box( 'my_taxonomydiv', $post_type, 'side' ); | |
add_meta_box( 'my_taxonomydiv', 'My Taxonomy', 'my_meta_box', $post_type, 'side' ); | |
} | |
function my_meta_box( $post, $meta_box ) { | |
$taxonomy = 'my_taxonomy'; | |
$tax = get_taxonomy( $taxonomy ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'init', 'add_widget_order_class' ); | |
function add_widget_order_class() { | |
global $wp_registered_sidebars, $wp_registered_widgets; | |
$sidebars = wp_get_sidebars_widgets(); | |
if ( empty( $sidebars ) ) | |
return; | |
foreach ( $sidebars as $sidebar_id => $widgets ) { |