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 | |
/** | |
* WordPress Test Server | |
* | |
* This serves up a full WordPress site via the PHP test server (`php -S`), and | |
* is intended purely for serving WP for UI testing. Please do not ever use this | |
* in production. | |
*/ | |
// Path to WP install |
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: Rarst's favorite plugin | |
* Description: SHUT UP | |
* Version: INF | |
* Author: The unholy army of trolls | |
* License: GPLv2 or MIT (they're equivalent, right?) | |
*/ | |
add_action( 'all', function() { | |
global $wp_filter; |
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
sites | |
|__ ms.dev | |
| |__ content | |
| |__ index.php | |
| |__ wp => ../../wordpress/stable | |
| |__ wp-config.php | |
|__ one.dev | |
| |__ content | |
| |__ index.php | |
| |__ wp => ../../wordpress/stable |
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
# Adjust this to include any other necessary files. | |
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { | |
expires 24h; | |
log_not_found off; | |
try_files $uri $uri/ @production; | |
} | |
location @production { | |
resolver 1.1.1.1; | |
proxy_pass http://{replace-with.domain.com}/$uri; |
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
/** | |
* The code below renders additional custom attachment fields into the | |
* new media manager. | |
* | |
* I am assuming you are using your own custom media modal frame. By | |
* extending the default Attachment.Details subview, we can append our | |
* custom fields to the default fields listed. | |
* | |
* In the initialize function, we ensure that our changes are always up | |
* to date by "listening" to our model's change event and updating the |
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 | |
/** | |
* An example function used to demonstrate how to use the `user_can_save` function | |
* that provides boilerplate security checks when saving custom post meta data. | |
* | |
* The ultimate goal is provide a simple helper function to be used in themes and | |
* plugins without the need to use a set of complex conditionals and constants. | |
* | |
* Instead, the aim is to have a simplified function that's easy to read and that uses | |
* WordPress APIs. |
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
// Build a query for all attachments uploaded to a post. | |
var gallery = wp.media.query({ uploadedTo: postId }); | |
// Run the query. | |
// This returns a promise (like $.ajax) so you can do things when it completes. | |
gallery.more(); | |
// Bind your events for when the contents of the gallery changes. | |
gallery.on( 'add remove reset', function() { | |
// Something changed, update your stuff. |
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
green=$(tput setaf 2) | |
yellow=$(tput setaf 3) | |
magenta=$(tput setaf 5) | |
reset=$(tput sgr0) | |
# This was not working with \w, which has since been changed to \W in favor of window title showing $PWD | |
# PROMPT_DIRTRIM=3 | |
export EDITOR='code --wait'; | |
export SVN_EDITOR='code --wait'; |
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
#!/bin/bash | |
# args | |
MSG=${1-'deploy from git'} | |
BRANCH=${2-'trunk'} | |
# paths | |
SRC_DIR=$(git rev-parse --show-toplevel) | |
DIR_NAME=$(basename $SRC_DIR) | |
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH |
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
// Modific default settings | |
{ | |
// Name of a region icon | |
// Valid icon names are dot, circle, bookmark and cross | |
"region_icon": "circle", | |
// You can use your commands instead of plain "git" or "svn" | |
// e.g. "/usr/bin/git" or "C:\bin\git.exe" | |
"vcs": [ | |
["svn", "/usr/bin/svn"], |
NewerOlder