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 | |
/** | |
* In answer to https://twitter.com/Kathy_Darling/status/805902856536674304 | |
* | |
* Anyone know how to remove a @WooCommerce session variable once you've set it? | |
* | |
*/ | |
// One can set the variable to null, like it is done with wc_notices: |
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
/** | |
* 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 ); |
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
/** | |
* 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>'; | |
} |
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 | |
/** | |
* 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 |
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
<select> | |
<option value="0">Selecione</option> | |
<option value="AC">Acre</option> | |
<option value="AL">Alagoas</option> | |
<option value="AP">Amapá</option> | |
<option value="AM">Amazonas</option> | |
<option value="BA">Bahia</option> | |
<option value="CE">Ceará</option> | |
<option value="DF">Distrito Federal</option> | |
<option value="ES">Espirito Santo</option> |
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 # -*- 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 | |
*/ |
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 | |
/* | |
Plugin Name: R Debug | |
Description: Set of dump helpers for debug. | |
Author: Andrey "Rarst" Savchenko | |
Author URI: http://www.rarst.net/ | |
License: MIT | |
*/ | |
/** |
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
add_filter( 'woocommerce_get_price_html', 'omniwp_credit_dollars_price', 10, 2 ); | |
function omniwp_credit_dollars_price( $price, $product ) { | |
$pricing_rule_sets = get_post_meta( $product->post->ID, '_pricing_rules', true ); | |
$pricing_rule_sets = array_shift( $pricing_rule_sets ); | |
if ( $pricing_rule_sets | |
&& is_array( $pricing_rule_sets ) | |
&& sizeof( $pricing_rule_sets ) ) { | |
ob_start(); |