Skip to content

Instantly share code, notes, and snippets.

@Spellhammer
Spellhammer / gist:2b4547c36c2e2d9a8e0fa9ec84c83cf7
Last active January 25, 2022 17:51
Post Type Condition For ACF Extended Post Types
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 April 28, 2020 15:10
Get field from current user's Profile (ACF)
// 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 August 15, 2022 10:30
Check for presence of URL parameter condition for Oxygen
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( isset($_GET[$value]) && $_GET[$value] ) {
@Spellhammer
Spellhammer / accessurlcondition
Created April 28, 2020 15:01
"Access" URL Param Condition for Oxygen
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 April 23, 2020 15:33
Manually set active menu styles using 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');
@Spellhammer
Spellhammer / 3.2.1.final.changelog
Created March 25, 2020 11:41
Oxygen 3.2.1 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 March 18, 2020 14:47
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 March 10, 2020 13:13
WooCo Product Thumbnails As Navigation "Dots"
#-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 February 18, 2020 03:40
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 January 28, 2020 15:10
Oxygen 3.2 Beta 1 Changelog
## 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