Skip to content

Instantly share code, notes, and snippets.

@helgatheviking
helgatheviking / functions.php
Last active November 9, 2021 23:50 — forked from kloon/functions.php
WooCommerce Dropdown Product Quantity (not compatible with Mix and Match, Product Bundles, etc)
<?php
/**
* Change the quantity input to select.
*
* @param array $args Args for the input.
* @param WC_Product|null $product Product.
* @param boolean $echo Whether to return or echo|string.
*
* @return string
*/
@helgatheviking
helgatheviking / class-wc-shipstation-api-export.php
Created January 30, 2019 15:56 — forked from skillio/class-wc-shipstation-api-export.php
Woocommerce Shipstation Integration tiny patch--xml output filter
/* Apologies for formatting, this was originally intended to be a ticket, but it errored. */
// Line 295 of Woocommerce Shipstation Integration 4.1.27 includes/api-requests/class-wc-shipstation-api-export.php is currently:
$orders_xml->appendChild( $order_xml );
// Proposed Change:
$orders_xml->appendChild( apply_filters( 'woocommerce_shipstation_export_order_xml', $order_xml) );
/*
Lots of ways this can be used, for example, pulling from a staging site and using an internal email so as not to notify customers when testing.

Fluid Grid Using Text-align: Justify

A new technique for responsive grids I've been working on which uses inline-block and text-align: justify.

Take a look at this article for an explanation of the fundamentals of the technique:

http://www.barrelny.com/blog/text-align-justify-and-rwd/

Essentially, margins are calculated by the browser and never specified in the CSS. This saves a lot of tedious work! Also by not having to use floats, clearfixes, or nth-child, we avoid many common problems associated with more traditional methods.

@helgatheviking
helgatheviking / editor_meta.php
Created February 15, 2012 18:35 — forked from bicyclista/wpalchemy wp_editor()
wpalchemy metaboxes VS. wordpress wp_editor()
<div class="my_meta_control">
<?php $mb->the_field('test_editor');
$settings = array(
'textarea_rows' => '10',
'media_buttons' => 'false',
'tabindex' =>2
);
@helgatheviking
helgatheviking / wpalchemy-tinymce-template.php
Created February 11, 2012 03:01 — forked from mamouneyya/wpalchemy-tinymce-template.php
Repeatable and sortable TinyMCE fields for WP Alchemy class
<?php while($mb->have_fields_and_multi('GROUP-NAME')): ?>
<?php $mb->the_group_open(); ?>
<p class="update-warning">Remember, you must save the page for the sort order to take effect.</p>
<?php $metabox->the_field('CONTENT-FIELD'); ?>
<label for="<?php $metabox->the_name(); ?>">FIELD LABEL</label>
<div class="customEditor">
<textarea rows="10" cols="50" name="<?php $mb->the_name(); ?>" id="<?php $mb->the_name(); ?>"><?php $mb->the_value(); ?></textarea>
</div>