Skip to content

Instantly share code, notes, and snippets.

View wplit's full-sized avatar
💭
I may be slow to respond.

David Browne wplit

💭
I may be slow to respond.
View GitHub Profile
@wplit
wplit / footer-scripts.html
Last active July 27, 2026 03:24
add to calender function re-init for jet engine calendar
@wplit
wplit / snippet.php
Created July 21, 2026 02:59
Example: Add 'Favorited Count' column to products list
// Array of post types to include the column
function x_favorite_post_types() {
return [
'product' /* product post type */
];
}
// Add custom column
@wplit
wplit / snippet.php
Created July 21, 2026 02:57
Example: Add 'Favorited Products' column to users list
// Add custom column to Users list
add_filter( 'manage_users_columns', 'x_add_user_favorites_column' );
function x_add_user_favorites_column( $columns ) {
$columns['x_favorited_products'] = 'Favorited Products';
return $columns;
}
// Output column value
add_filter( 'manage_users_custom_column', 'x_show_user_favorites_column_content', 10, 3 );
function x_show_user_favorites_column_content( $value, $column_name, $user_id ) {
@wplit
wplit / style.css
Last active July 16, 2026 22:22
add arrows to events to show they continue off the calendar
/* Event continues BEFORE */
%root% .x-calendar-event:not(.fc-classic-3J4).fc-classic-USt::before {
content: '<';
color: var(--fc-event-contrast-color);
}
/* Event continues AFTER */
%root% .x-calendar-event.fc-classic-3J4:not(.fc-classic-USt)::after {
content: '>';
color: var(--fc-event-contrast-color);
@wplit
wplit / footer-scripts.js
Last active July 14, 2026 13:13
watch section for dom changing, re-init add to calendar
@wplit
wplit / code.js
Created June 30, 2026 09:18
prevent fancybox from scrolling gallery with wheel
document.addEventListener('DOMContentLoaded', function() {
if (window.jQuery && window.jQuery.fancybox) {
jQuery(document).on('onInit.fb', function(e, instance) {
if (instance && instance.$refs && instance.$refs.stage) {
instance.$refs.stage.off('mousewheel DOMMouseScroll wheel MozMousePixelScroll');
instance.$refs.stage.on('mousewheel DOMMouseScroll wheel MozMousePixelScroll', function(e) {
e.preventDefault();
@wplit
wplit / code.js
Created June 28, 2026 01:07
click hotspot marker when link is clicked/hovered
document.addEventListener('DOMContentLoaded', function() {
const links = document.querySelectorAll('.my-link');
const popoverButtons = document.querySelectorAll('#%%ELEMENT_ID%% .oxy-popover_marker');
links.forEach((link, index) => {
const correspondingButton = popoverButtons[index];
if (correspondingButton) {
// Click handler
@wplit
wplit / footer-scripts.html
Last active May 29, 2026 06:43
set number of decimal places for values in pie chart - add to page settings > custom code > footer scripts
@wplit
wplit / code.php
Last active May 20, 2026 01:09
remove glossary-hovercards scripts where it's not needed (which in turn, removes the tippy dependancy)
<?php
add_action( 'wp_footer', function() {
// Option 1: Remove on specific pages
if ( is_page( array( 'your-page-slug', 'another-page' ) ) ) {
wp_dequeue_script( 'glossary-hovercards' );
wp_deregister_script( 'glossary-hovercards' );
}
@wplit
wplit / footer-scripts.html
Last active May 19, 2026 08:02
change calendar locale to match site language.