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 xf_insert_image( $html, $id, $caption, $title, $align, $url ) | |
| { | |
| $html5 = "<figure id='post-$id media-$id' class='align-$align'>"; | |
| $html5 .= "<img src='$url' alt='$title' />"; | |
| $html5 .= "<figcaption>$caption</figcaption>"; | |
| $html5 .= "</figure>"; | |
| return $html5; | |
| } |
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 | |
| /** | |
| * Get the hash of the current git HEAD | |
| * @param str $branch The git branch to check | |
| * @return mixed Either the hash or a boolean false | |
| */ | |
| function get_current_git_commit( $branch='master' ) { | |
| if ( $hash = file_get_contents( sprintf( '.git/refs/heads/%s', $branch ) ) ) { | |
| return $hash; | |
| } else { |
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
| /** | |
| * | |
| * Secure Hash Algorithm (SHA1) | |
| * http://www.webtoolkit.info/ | |
| * | |
| **/ | |
| function SHA1 (msg) { | |
| function rotate_left(n,s) { |
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
| <!doctype html><html><head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta charset="utf-8"> | |
| <link rel="dns-prefetch" href="//s2.me2j.com" /><link rel="dns-prefetch" href="//i2.me2j.com" /> | |
| <!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> | |
| <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]--> | |
| <title>Lapa</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> | |
| <!-- | |
| All other head parts | |
| --> |
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
| $ ack --php 'class [\w]+'|grep -v '//'|grep -v '*'|grep -v '>'|sed 's/.*class //'|sed 's/ .*//' | |
| WP_Widget | |
| WP_Widget_Factory | |
| WP_Embed | |
| Moxiecode_JSONReader | |
| Moxiecode_JSON | |
| Moxiecode_Logger | |
| GoogleSpell | |
| PSpell | |
| SpellChecker |
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 | |
| /* | |
| Author: Jim Westergren & Jeedo Aquino | |
| File: index-with-redis.php | |
| Updated: 2012-10-25 | |
| This is a redis caching system for wordpress. | |
| see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/ |
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 | |
| /** | |
| * Ranking Library | |
| * contains alogrithms for story ranking | |
| * Basically a PHP Implementation of reddits algorithms | |
| * | |
| * @author Lucas Nolte <[email protected]> | |
| * @since 0.1 | |
| * @package Polska Wiadomosc | |
| * @subpackage Libraries |
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: WP_Rewrite endpoints demo | |
| Description: A plugin giving example usage of the WP_Rewrite endpoint API | |
| Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/ | |
| Author: Jon Cave | |
| Author URI: http://joncave.co.uk/ | |
| */ | |
| function makeplugins_endpoints_add_endpoint() { |
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: Generate Thumbnails On The Fly | |
| Description: When a thumbnail image is requested of a specific width/height (rather than by name), generate it if it doesn't exist. | |
| Version: 1.0.0 | |
| Author: Alex Mills (Viper007Bond) | |
| Author URI: http://www.viper007bond.com/ |
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
| /* | |
| * goes in theme functions.php or a custom plugin | |
| **/ | |
| // add item to cart on visit | |
| add_action( 'template_redirect', 'add_product_to_cart' ); | |
| function add_product_to_cart() { | |
| if ( ! is_admin() ) { | |
| $product_id = 64; | |
| $found = false; | |
| //check if product already in cart |