Skip to content

Instantly share code, notes, and snippets.

@fxbenard
fxbenard / getrmpomakemo.sh
Created March 5, 2014 14:06
Pull translations with Transifex client, create the mo and remove the po
#! /bin/sh
# Pull all files from Transifex;
# Minimum percentage change to whatever you want
tx pull -a --minimum-perc=100
# Create .mo files from .po files.
# Twisted by WP-Translations.org, created by grappler.
for file in `find . -name "*.po"` ; do msgfmt -o ${file/.po/.mo} $file && rm $file ; done
@cfoellmann
cfoellmann / tribe-events-activation-connector-oop.php
Last active August 29, 2015 14:00
Auto-(De-)Activate 'The Events Calendar' with 'The Events Calendar Pro' + hide 'The Events Calendar' from plugins.php listing
<?php
class EventsConnector {
var $events_calendar;
public function __construct() {
$this->events_calendar = 'the-events-calendar/the-events-calendar.php';
$events_calendar_pro = WP_PLUGIN_DIR . '/events-calendar-pro/events-calendar-pro.php';
@bradt
bradt / url-coupons.js
Last active August 29, 2015 14:17
WooCommerce URL Coupons
$( document ).ready( function() {
var cookie_name = 'dbrains-coupon';
var cookie_name_error = 'dbrains-coupon-error';
if ( 'undefined' === typeof $.cookie( cookie_name ) ) {
return;
}
var message = 'The coupon code ' + $.cookie( cookie_name ).toUpperCase() + ' has been successfully applied.';
@fjarrett
fjarrett / gist:2653299
Last active October 4, 2015 14:28
Add prefixes to WordPress post types when a theme is activated
<?php
/* Checks to see if new post type names (with prefixes) are being used. If not, then the old
* post type names are converted as long as there aren't conflicting post type names that are
* being registered by other plugins.
*
* @hook {action} after_setup_theme
*/
function fjarrett_prefix_post_types(){
global $wpdb;
@kingkool68
kingkool68 / Seamless Git Deployment
Last active December 17, 2015 05:09
To push code changes to text servers I do this.
We have a private Git running on a server somewhere which we consider our central repository. Inside the .git/hooks/post-recieve is the following:
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
@mpeshev
mpeshev / theme-review-porto.md
Last active December 27, 2015 22:18
Theme Review Porto plan
@GaryJones
GaryJones / functions.php
Last active January 11, 2016 05:19
Default styles for HTML5 galleries and captions.
<?php
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
@ShinichiNishikawa
ShinichiNishikawa / newreview
Last active June 26, 2016 14:08
Creating a whole new Theme Review environmet in 1 minute using wp-cli
wp db reset --yes
wp core install --url=http://theme-review.loc --title="This is a really long long title to check if this theme design doesn't break with the long site title" --admin_user=admin --admin_password=admin --admin_email=example@example.com
wp core update
wp plugin install theme-check debug-bar log-deprecated-notices monster-widget wordpress-importer show-current-template customizer-theme-resizer --activate
wp plugin install wordpress-beta-tester debogger jetpack
wp plugin update --all
wp option update blogdescription "I'm in the theme review process and this is a very very long tagline to see if this long tagline text string in WordPress doesn't break the design of the theme header and else."
wp option update posts_per_page 5
wp option update thread_comments 1
wp option update thread_comments_depth 3
@hlashbrooke
hlashbrooke / Slack theme for Post Status
Last active May 16, 2017 18:33
Slack theme for the Post Status channel. To use this theme, go to the 'Sidebar Theme' tab in your preferences pane and add this text to the custom theme field.
#2E3641,#FC781F,#1088C4,#FFFFFF,#808080,#FFFFFF,#FC781F,#1088C4
<?php
/**
* Plugin Name: Dev Plugins
*/
add_action( 'muplugins_loaded', function() {
// Plugins to activate automatically.
$auto_activate = [
'debug-bar/debug-bar.php',
'debug-bar-extender/debug-bar-extender.php',