Skip to content

Instantly share code, notes, and snippets.

@Spellhammer
Spellhammer / gist:2b4547c36c2e2d9a8e0fa9ec84c83cf7
Created May 11, 2020
Post Type Condition For ACF Extended Post Types
View gist:2b4547c36c2e2d9a8e0fa9ec84c83cf7
if( function_exists('oxygen_vsb_register_condition') ) {
add_action('init', 'register_post_type_condition_acfe', 99);
function register_post_type_condition_acfe() {
$post_types = array_values(get_post_types(array('public'=>true)));
global $oxy_condition_operators;
@Spellhammer
Spellhammer / getuserfield
Created Apr 28, 2020
Get field from current user's Profile (ACF)
View getuserfield
// Get field from current user's profile
function get_user_field( $field_name ) {
if( !$field_name ) { return; }
$user = "user_" . get_current_user_ID();
if( $field_name ) {
return get_field( $field_name, $user );
}
@Spellhammer
Spellhammer / urlparamexistscondition
Last active Apr 28, 2020
Check for presence of URL parameter condition for Oxygen
View urlparamexistscondition
if( function_exists('oxygen_vsb_register_condition') ) {
global $oxy_condition_operators;
// Condition to check if a URL parameter is present.
oxygen_vsb_register_condition('URL Param Exists', array('options'=>array(), 'custom'=>true), array('--'), 'oxy_url_param_exists_callback', 'Other');
function oxy_url_param_exists_callback($value, $operator) {
if( $_GET[$value] ) {
@Spellhammer
Spellhammer / accessurlcondition
Created Apr 28, 2020
"Access" URL Param Condition for Oxygen
View accessurlcondition
if( function_exists('oxygen_vsb_register_condition') ) {
global $oxy_condition_operators;
// Condition to check if a URL parameter is present.
oxygen_vsb_register_condition('Access Code', array('options'=>array(), 'custom'=>true), $oxy_condition_operators['string'], 'oxy_access_code_callback', 'Other');
function oxy_access_code_callback($value, $operator) {
if( $operator == '==') {
@Spellhammer
Spellhammer / manual-active-menu-items.js
Created Apr 23, 2020
Manually set active menu styles using JS.
View manual-active-menu-items.js
jQuery(document).ready( function() {
var path = window.location;
jQuery(".menu-item a").each(function () {
var href = jQuery(this).attr('href');
if(path == href) {
jQuery(this).closest('li').addClass('current-menu-item');
View 3.2.1.final.changelog
## 2020/03/25
## Oxygen 3.2.1 Changelog
------------------------------
Polish: Improved cursor interaction for animated dropdowns that don't intersect with the cursor.
Tweak: Made entire parent menu item (instead of only the icon) trigger mobile toggle dropdown if the parent menu item's href is #.
Tweak: Prevented mouse interaction with animated dropdowns when they're animating out.
Enhancement: Added a min-width control for mobile menu link items.
Enhancement: Added width control for the Pro Menu off-canvas menu.
Fix: Corrected issue causing full-screen mobile menu to close when triggering mobile toggle dropdowns.
@Spellhammer
Spellhammer / Oxygen 3.2.1 RC 1 Changelog
Last active Mar 18, 2020
Oxygen 3.2.1 RC 1 Changelog
View Oxygen 3.2.1 RC 1 Changelog
## 2020/03/18
## Oxygen 3.2.1 RC 1 Changelog
------------------------------
Polish: Improved cursor interaction for animated dropdowns that don't intersect with the cursor.
Tweak: Made entire parent menu item (instead of only the icon) trigger mobile toggle dropdown if the parent menu item's href is #.
Tweak: Prevented mouse interaction with animated dropdowns when they're animating out.
Enhancement: Added a min-width control for mobile menu link items.
Enhancement: Added width control for the Pro Menu off-canvas menu.
Fix: Corrected issue causing full-screen mobile menu to close when triggering mobile toggle dropdowns.
@Spellhammer
Spellhammer / gist:08dcd4634399d3e0ccf1e2dbea171f61
Created Mar 10, 2020
WooCo Product Thumbnails As Navigation "Dots"
View gist:08dcd4634399d3e0ccf1e2dbea171f61
#-product-images-8-117 .flex-control-thumbs {
padding: 16px 32px 16px 32px;
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
}
#-product-images-8-117 .woocommerce-product-gallery .flex-control-thumbs > li {
min-width: 0px;
@Spellhammer
Spellhammer / 3.2 RC 1 Changelog
Last active Feb 18, 2020
3.2 RC 1 Changelog
View 3.2 RC 1 Changelog
## 2020/02/18
## Oxygen 3.2 RC 1 Changelog
------------------------------
Polish: Continued improvement of Pro Menu element, fixed various bugs and polished features
Fix: Corrected regression preventing Oxygen dynamic data from working in image alt field
Fix: Corrected regression preventing transition duration CSS from being output when set via a class
@Spellhammer
Spellhammer / changelog.txt
Last active Jan 28, 2020
Oxygen 3.2 Beta 1 Changelog
View changelog.txt
## 2020/01/28
## Oxygen 3.2 Beta 1 Changelog
------------------------------
Tweak: Improved shortcode encoding by centralizing the encoding function
Tweak: Adjusted the way Oxygen handles "blank" shortcodes during save failure to reduce chance of content deletion
Fix: Section backgrounds are no longer output inline unless they're set dynamically or via Gutenberg
Fix: WooCommerce cart total element no longer breaks things