This file contains 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 | |
add_action ( 'wp_head', 'add_jquery_when_comments_in_viewport', 11 ); | |
function add_jquery_when_comments_in_viewport() | |
{ | |
?> | |
<script type="text/javascript"> | |
/* <![CDATA[ */ | |
function jquery_for_comments_onLoad() { | |
var element = document.getElementById( "comments" ), | |
current = document.body.clientHeight+document.body.scrollTop, |
This file contains 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 | |
/** | |
* STYLESHEETS | |
*/ | |
function print_device_styles( $client = 'desktop' ) | |
{ | |
$client = apply_filters( 'set_theme_client', $client ); | |
wp_enqueue_style( $client.'-css' ); | |
} | |
add_action( 'wp_head', 'print_device_styles', 11 ); |
This file contains 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() | |
{ | |
tinymce.create('tinymce.plugins.BrettsYouTube', | |
{ | |
init : function(ed, url) { | |
ed.addButton('brettsyoutube', | |
{ | |
title : 'brettsyoutube.youtube', | |
image : 'http://localhost/wordpress/wp-includes/js/tinymce/themes/advanced/img/icons.gif', | |
onclick : function() |
This file contains 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 | |
defined( 'ABSPATH' ) OR exit; | |
/* | |
Plugin Name: WP Cron Jobs List | |
Plugin URI: https://github.com/franz-josef-kaiser | |
Description: List WordPress internal cron jobs (array data) after the footer. | |
Author: Franz Josef Kaiser | |
Author URI: https://github.com/franz-josef-kaiser | |
Version: 0.3.1 | |
License: MIT |
This file contains 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: Plugin update lister | |
Plugin URI: https://gist.github.com/995560 | |
Description: Adds a table to your ´wp_footer()´ that lists all plugins that need updates. The plugin works out of the box. | |
Author: Franz Josef Kaiser | |
Author URI: https://github.com/franz-josef-kaiser | |
Version: 0.1. | |
License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
This file contains 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 | |
// Straight from "The Hitchhiker's Guide to the Galaxy" | |
// Try to put 'Taylor' as first name & 'Yates' as $last_name | |
function answer_my_question( $first_name, $last_name ) | |
{ | |
$answer_to_all_questions = floor( intval( octdec( decoct( md5( $last_name ) ) ) ) / intval( octdec( decoct( md5( $first_name ) ) ) ) * 9 ); | |
echo $answer_to_all_questions; | |
} | |
?> |
This file contains 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 | |
/** | |
* Debugging | |
* | |
* @example: add_filter( 'debug', create_function( '$a', 'return $handle;' ) ); | |
* | |
* @param unknown_type $input | |
* @param unknown_type $print_r_dump | |
* @param unknown_type $print | |
* @return (mixed) $output |
This file contains 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 | |
/** | |
* The "global" data handle function | |
* | |
* This function can serve a lot of different purposes. | |
* Incl. merging db values from an options entry with input arguments. | |
* | |
* Throws a fully translateable Error if no database option name was specified. | |
* Tells you from which file the Error was triggered and in which line you should search it. | |
* Also tells you the "global_$args['UID']" name of the action hook where the Error occured. |