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 / 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
@wplit
wplit / bricksextras.pot
Last active January 22, 2026 02:40
BricksExtras translations POT file (for in-builder / admin translations)
# Copyright (C) 2026 BricksExtras
# This file is distributed under the same license as the BricksExtras plugin.
msgid ""
msgstr ""
"Project-Id-Version: BricksExtras\n"
"Report-Msgid-Bugs-To: https://bricksextras.com\n"
"POT-Creation-Date: 2026-01-21 01:05+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@wplit
wplit / code.php
Created January 17, 2026 00:21
add new breadcrunk link to breadcrumbs
<?php
add_filter( 'bricksextras/breadcrumbs/', function( $crumbs ) {
$crumbPosition = 1;
$url = 'https://kevinc366.sg-host.com/tournaments/';
$text = 'Tournaments';
/* if single event, add new breadcrumb */
@wplit
wplit / code.php
Last active January 10, 2026 21:24
Redirect WordPress search to WPGB search format
<?php
/**
* Redirect WordPress search to WPGB search format
*/
add_action('template_redirect', function() {
if (isset($_GET['s']) && !empty($_GET['s'])) {
$search_query = sanitize_text_field($_GET['s']);
@wplit
wplit / footer-scripts.html
Last active December 29, 2025 00:30
do something when page tour step hides