Skip to content

Instantly share code, notes, and snippets.

@greguly
greguly / r-debug.php
Last active August 29, 2015 14:06 — forked from Rarst/r-debug.php
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: http://www.rarst.net/
License: MIT
*/
/**
<?php # -*- coding: utf-8 -*-
/*
Plugin Name: All Actions List
Description: Lists all actions run during one request.
Version: 1.0
Required: 3.1
Author: Thomas Scholz
Author URI: http://toscho.de
License: GPL
*/
@greguly
greguly / pinit_onlyon.php
Last active November 19, 2015 11:06 — forked from rayflores/pinit_onlyon.php
add attachment meta, and remove pinterest pinit button from those images with meta box checked...
<?php
/**
* Plugin Name: Pinit Only On Selected Media
* Plugin URI: http://www.rayflores.com/plugins/pinit-onlyon/
* Version: 1.0
* Author: Ray Flores
* Author URI: http://www.rayflores.com
* Description: Adds ability to select media attachments to be unpinned.
* Requires at least: 4.0
* Tested up to: 4.1
@greguly
greguly / gist:5ca726d82fcb707a534d
Last active December 23, 2015 08:27 — forked from woogist/gist:6267983
WooCommerce - Display checkout custom field on the order edition page
/**
* Display field value on the order edition page
**/
add_action( 'woocommerce_admin_order_data_after_billing_address', 'my_custom_checkout_field_display_admin_order_meta' );
function my_custom_checkout_field_display_admin_order_meta( $order ){
echo '<p><strong>'.__( 'My Field' ).':</strong> ' . get_post_meta( $order->id, 'My Field', true ) . '</p>';
}
@greguly
greguly / list-hooks.php
Created March 24, 2016 10:41 — forked from helgatheviking/list-hooks.php
Advanced debugging of all functions attached to a specific filter
/**
* Even fancier debug info
* @props @Danijel http://stackoverflow.com/a/26680808/383847
* @since 1.7.7
*/
function list_hooks( $hook = '' ) {
global $wp_filter;
$hooks = isset( $wp_filter[$hook] ) ? $wp_filter[$hook] : array();
$hooks = call_user_func_array( 'array_merge', $hooks );