Skip to content

Instantly share code, notes, and snippets.

var postL10n = {
comma: ','
}
jQuery( function() {
module( 'post-tags-metabox' );
// mock the tags div
var tagsDiv = jQuery( '<div />' ).addClass('tagsdiv').append(
jQuery( '<textarea>' ).val( 'tag1,tag2,"tag,with,comma"' ).addClass('the-tags')
@joehoyle
joehoyle / .zshrc
Last active December 22, 2015 22:19
v() {
DIR=`echo $PWD | sed 's,.*/projects,,'`
ARGS=$*
ssh -t [email protected] "cd /srv/www${DIR} ; ${ARGS}" 2> /dev/null
}
alias wp="v wp"
alias grunt="v grunt"
$value = sanitize_text_field( $_POST['value'] );
$id = (int) $_POST['id'];
$list_id = 1;
$meta = get_post_meta( $list_id, 'item' );
$old_value = $meta[$id];
update_post_meta( $lit_id, 'item', $value, $old_value );
php5-xdebug:
pkg:
- installed
/etc/php5/fpm/conf.d/20-xdebug.ini:
file.managed:
- contents: "zend_extension=/usr/lib/php5/20100525+lfs/xdebug.so\nxdebug.remote_enable=1\nxdebug.remote_handler = dbgp\nxdebug.remote_connect_back = on\nxdebug.remote_host=10.0.2.2"
- user: root
- group: root
- mode: 644
{
"name": "AwkwardFamilyPhotos",
"version": "0.0.0",
"description": "",
"main": "Gruntfile.js",
"dependencies": {
"grunt": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-less": "~0.7.0",
"grunt-contrib-uglify": "~0.2.2"
#!/bin/sh
set -e
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path
<?php
add_filter( 'wpthumb_post_image_path', function() {
return WP_CONTENT_DIR . '/uploads/' . rand( 0, 2 ) . '.jpg';
});
add_filter( 'get_attached_file', function( $path ) {
return WP_CONTENT_DIR . '/uploads/' . rand( 0, 2 ) . '.jpg';
});
server {
listen 80;
server_name clickbankpowered.dev *.clickbankpowered.dev;
root /Users/joe/Sites/bailey-bridge;
index index.php;
rewrite ^(/wp-(admin|includes)/(.*))$ /wordpress$1 last;
rewrite ^(/wp-[^/]*\.php)$ /wordpress$1 last;
location /dashboard/api/upload-video {
<?php
/* Path to the WordPress codebase you'd like to test. Add a backslash in the end. */
//define( 'ABSPATH', getenv( 'WP_CORE_DIR' ) . '/' );
define( 'ABSPATH', '../../../../wordpress/' );
define( 'WP_CONTENT_DIR', ABSPATH . '../content' );
// Set path to MU Plugins.
//define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins-mu' );
@joehoyle
joehoyle / api.php
Last active October 12, 2015 14:27
<?php
hm_add_rewrite_rule( array(
'request_method' => 'DELETE',
'regex' => '/api/v3/posts/([^/]+)',
'query' => 'post_id=$matches[1]',
'request_callback' => function( WP $wp ) {
wp_delete_post( $wp->query_vars['post_id'] );