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
Created February 24, 2026 00:20
re-run media functon when core framework changes theme color
@wplit
wplit / footer-scripts.html
Created February 23, 2026 06:34
force everything outside of open offcanvas to be none-focusable (add to page settings > custom code > footer scripts)
@wplit
wplit / footer-scripts.html
Created February 20, 2026 00:08
find all read more links in slider and collapse when slider changes active slide
@wplit
wplit / footer-scripts.html
Last active February 18, 2026 09:33
reset iframe from previous slide when moving between slides in lightbox
@wplit
wplit / subtitles.vtt
Created February 7, 2026 04:49
subtitles.vtt
WEBVTT
1
00:00:00.666 --> 00:00:02.416
Every business starts somewhere
2
00:00:02.625 --> 00:00:04.375
And
@wplit
wplit / code.php
Last active February 5, 2026 23:01
Add admin column to show favorited count next to each post, change 'product' to any post type
<?php
// Array of post types to include the column
function x_favorite_post_types() {
return [
'product' /* product post type */
];
}
@wplit
wplit / code.php
Created February 3, 2026 05:16
add little css notice to bricks components in gutenberg (code snippet)
<?php
add_action('enqueue_block_editor_assets', function() {
wp_add_inline_style('wp-edit-blocks', '
.wp-block[data-type*="bricks-component"] > div::after,
.wp-block[data-type*="default/gutenb"] > div::after {
content: "See additional settings in the sidebar on the right";
@wplit
wplit / code.php
Last active January 30, 2026 05:55
example code, queuing a toast on WooCommerce' redirect hook
<?php
add_filter( 'woocommerce_add_to_cart_redirect', 'show_add_to_cart_toast', 10, 1 );
function show_add_to_cart_toast( $url ) {
$product_id = absint( $_REQUEST['add-to-cart'] ?? 0 );
if ( $product_id ) {
$product = wc_get_product( $product_id );
@wplit
wplit / footer-scripts.html
Last active January 26, 2026 00:06
'autoplay' the before/after --x-before-after-position variable until user interaction
@wplit
wplit / footer-scripts.html
Created January 22, 2026 21:50
attempt to play player when playlist item clicked