View gist:de6ac5f80e89297fcb8f
1
WP_CLI::run_command( array( 'search-replace', 'old', 'new' ), array( 'network' => true ) );
View content.txt
1 2 3 4 5 6 7 8 9 10
Lorem ipsum
 
[shortcode]
<ul>
<li>foo</li>
<li>bar</li>
</ul>
[/shortcode]
 
Lorem ipsum
View cli-media-fix.php
1 2 3 4 5 6 7 8 9 10
<?php
if ( ! defined( 'WP_CLI' ) ) return;
/**
* Media Fix
*/
class Media_Fix extends WP_CLI_Command {
/**
View db-config.php
1 2 3 4 5 6 7 8 9 10
<?php
/**
* HyperDB configuration file
*
* This file should be installed at ABSPATH/db-config.php
*
* $wpdb is an instance of the hyperdb class which extends the wpdb class.
*
* Fully documented config file:
* http://plugins.svn.wordpress.org/hyperdb/trunk/db-config.php
View media-fix.php
1 2 3 4 5 6 7 8 9 10
<?php
if ( ! defined( 'WP_CLI' ) ) return;
/**
* Media Fix
*/
class Media_Fix extends WP_CLI_Command {
/**
View getopt-example.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
 
ARGS=$(getopt -o a:b -l "ay:,bee:,dry-run" -n "cli.sh" -- "$@");
eval set -- "$ARGS";
 
while (("$#")); do
case "$1" in
-a|--ay)
shift;
if [ -n "$1" ]; then
View robots-crawl-delay.php
1 2 3 4 5 6 7 8 9 10
<?php
/**
* Plugin Name: Robots Crawl Delay
*/
function prefix_robots_crawl_delay( $output, $public ) {
$output .= "Crawl-delay: 8\n";
return $output;
}
add_filter( 'robots_txt', 'prefix_robots_crawl_delay', 10, 2 );
View purge.sh
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/php
<?php
/**
* This works for the following nginx configuration:
*
* fastcgi_cache_path [..] levels=1:2 [..];
* fastcgi_cache_key "$scheme://$host$request_uri";
*
* Make this file executable
* `chmod +x /path/to/this/file`
View blog-home.php
1 2 3 4 5 6 7 8 9 10
<?php
$basic_rewrite = new Basic_Rewrite();
class Basic_Rewrite {
function __construct() {
add_action( 'wp_loaded', array( $this, 'wp_loaded' ) );
add_filter( 'rewrite_rules_array', array( $this, 'rewrite_rules_array' ) );
add_filter( 'query_vars', array( $this, 'query_vars' ) );
add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
Something went wrong with that request. Please try again.