Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<?php | |
/* | |
* Usage: | |
* 1. Paste into Debug Bar console and Run | |
* 2. Run it several times (just in case iTunes is running on your dev server) | |
* | |
* Benchmarking Alternatives: | |
* - Wrap the real SEO Auto Linker for wp-cli and replace the call to content() | |
* - Add this quick & dirty benchmark loop to Debug Bar | |
* |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8444"; | |
} | |
sub vcl_recv { | |
# Allow the back-end to serve up stale content if it is responding slowly. | |
set req.grace = 2m; |
<?php | |
/* This snippet removes the action that inserts thumbnails to products in teh loop | |
* and re-adds the function customized with our wrapper in it. | |
* It applies to all archives with products. | |
* | |
* @original plugin: WooCommerce | |
* @author of snippet: Brian Krogsard | |
*/ | |
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); |
<?php | |
/** | |
* Section Menu | |
* Displays the subpages of the current section | |
* | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/custom-secondary-menu | |
*/ | |
function be_section_menu() { |
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; | |
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; | |
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; | |
DROP SCHEMA IF EXISTS `mydb` ; | |
CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ; | |
USE `mydb` ; | |
-- ----------------------------------------------------- | |
-- Table `mydb`.`users` |
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldsite.com','http://www.newsite.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldsite.com', 'http://www.newsite.com'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.oldsite.com', 'http://www.newsite.com'); |
<?php | |
/** | |
* Possibly amend the loop. | |
* | |
* Specify the conditions under which the grid loop should be used. | |
* | |
* @author Bill Erickson | |
* @author Gary Jones | |
* @link http://code.garyjones.co.uk/genesis-grid-loop-advanced/ |
<?php | |
add_filter( 'genesis_author_box', 'be_author_box', 10, 6 ); | |
/** | |
* Author Box | |
* | |
*/ | |
function be_author_box( $output, $context, $pattern, $gravatar, $title, $description ) { | |
$output = ''; | |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.