The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
/** | |
* Map-get function for nested variable maps | |
* (required) | |
*/ | |
@function map-deep-get($map, $keys...) { | |
@each $key in $keys { | |
$map: map-get($map, $key); | |
} | |
@return $map; |
<?php | |
/* | |
Debug preview with custom fields | |
Taken from: http://support.advancedcustomfields.com/forums/topic/preview-solution/ | |
See also: http://support.advancedcustomfields.com/forums/topic/2nd-every-other-post-preview-throws-notice/ | |
*/ | |
add_filter('_wp_post_revision_fields', 'add_field_debug_preview'); | |
function add_field_debug_preview($fields){ | |
$fields["debug_preview"] = "debug_preview"; | |
return $fields; |
A meta query to be used with the Members plugin by Justin Tadlock. This meta query and will not have any effect without the plugin installed and active.
This Meta Query has two arguments and accepts either one. They are both based on post meta assigned using the Members plugin Content Permissions meta box on the post edit screen.
This meta query argument will exclude any posts from your custom WP_Query
with roles assigned in the Content Permissions meta box that do not match the current user's role.
/** | |
* Add 3DPrint weight and dimensions to WooCommerce cart item objects | |
* @author mike@curren.me | |
* | |
* @requires WooCommerce plugin - https://woocommerce.com/ | |
* @requires Wordpress 3D Printing plugin - http://www.wp3dprinting.com/ | |
*/ | |
function add_3dp_stats_to_wc_cart_objects( $cart_object ) { |
I hereby claim:
To claim this, I am signing this object:
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
// Set the desired number of columns in a variable for flexibility | |
$total-columns: 24; | |
// Create a placeholder for the grid container |