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 | |
// Updated, the other expression misses stuff like nulla.jpg which broke images | |
// (?<!-)\b(ipsum|nulla|Nulla)\b(?!\/|\"|\.[a-zA-Z0-9]) | |
//---------------------------- | |
// Example string | |
//---------------------------- | |
?> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc feugiat laoreet augue, non congue lectus mattis nec. Etiam augue risus, consequat et sodales at, scelerisque id orci. Sed posuere egestas tristique. Aenean fermentum volutpat nisi, nulla vitae convallis risus mollis vel. <a title="nulla" href="http://nulla/nulla">Nulla</a> Nulla convallis venenatis tortor, nec congue augue hendrerit quis. Fusce augue metus, venenatis posuere ornare quis, scelerisque sed quam. <img alt="ipsum" src="ipsum.png" title="ipsum">Nunc nec adipiscing justo. Morbi eget ultrices diam. Proin nisl nisl, aliquet quis aliquet non, sollicitudin ultricies lectus. Etiam malesuada mauris quis sem varius hendrerit. Etiam eu tempor magna. Donec quam metus, elementum eget sollicitudin adipiscing, porttitor di |
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 | |
/** | |
* Abstract class which has helper functions to get data from the database | |
*/ | |
abstract class Base_Custom_Data | |
{ | |
/** | |
* The current table name | |
* | |
* @var boolean |
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
cd $(brew --repository) | |
sudo chown -R $USER . | |
git reset --hard origin/master | |
brew update |
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 | |
/** | |
* Register Custom Status | |
* | |
*/ | |
function custom_archived_post_status() { | |
$args = array( |
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
// http://mattbanks.me/grunt-wordpress-development-deployments/ | |
// https://github.com/mattbanks/WordPress-Starter-Theme/blob/master/Gruntfile.js | |
'use strict'; | |
module.exports = function (grunt) { | |
// load all grunt tasks matching the `grunt-*` pattern | |
require('load-grunt-tasks')(grunt); | |
var $proxy = 'vvv_domain.dev'; |
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
# Not saying this is a fix all, but this is what I had to do to get VVV running properly on my system. | |
# It failed to install properly do to script errors | |
# Branch master | |
# head 7f5411455573bba88d8ce232db957c62b11977f5 | |
# VVV Update issues | |
vagrant ssh | |
su | |
#pass |
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 | |
// This code can go anywhere as long as its loaded by a plugin or theme | |
// setup the schedual | |
if ( ! wp_next_scheduled( 'my_task_hook' ) ) { | |
wp_schedule_event( time(), 'hourly', 'my_task_hook' ); | |
} | |
add_action( 'my_task_hook', 'my_task_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 | |
// Don't load theme data IE css and other features | |
define( 'WP_USE_THEMES', false ); | |
/* | |
* Loads the WordPress Environment and Template | |
* Change PATH_TO_WP to the path of the following file | |
*/ | |
require( 'PATH_TO_WP/wp-blog-header.php' ); |
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
#!/bin/bash | |
# | |
# provision.sh | |
# | |
# Customized by Jeff Behnke @topdown on GitHub | |
# | |
# This file is a custom provision script for VVV that skips all updates and update checks | |
# It only does the absolute tasks that I know are needed for vagrant up, vagrant reload, vagrant provision and vv create | |
# It currently runs vagrant provision tasks in roughly 8 secs. | |
# You should be using VV for creating sites, then replace its custom-provision.sh with this one once you have a working VVV system. |
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 | |
function jb_show_rewrite_rules() { | |
$rules = get_option('rewrite_rules'); | |
$n = 0; | |
$html = '<table><tr><th style="width: 5%;">#</th><th style="width: 35%;">Key</th><th style="width: 60%;">Rule</th></tr>'; | |
foreach ( $rules as $key => $value ) { | |
$html .= '<tr><td>' . ++$n . '</td><td>' . $key . '</td><td>' . $value . '</td></tr>'; | |
} // end foreach |