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 / acf.json
Created April 8, 2026 04:37
event acf fields
{
"key": "group_xcalendar_events",
"title": "Calendar Event Fields",
"fields": [
{
"key": "field_xcalendar_basic_info_tab",
"label": "Basic Event Information",
"name": "",
"type": "tab",
"instructions": "",
@wplit
wplit / footer-scripts.html
Created April 7, 2026 22:09
force bricks to recalc sub menu position when header sticky/unsticky
@wplit
wplit / style.css
Last active March 26, 2026 04:02
some css for styling arrows in structure panel
/* to make them more visible (default was 0.4) */
#bricks-structure .structure-item svg {
opacity: 1;
}
/* to change the color of the arrows */
#bricks-structure .toggle svg {
color: red;
}
@wplit
wplit / code.php
Created March 21, 2026 06:49
test nestable element
<?php
class X_Test_Element extends \Bricks\Element {
// Element properties
public $category = "general";
public $name = "xtestelement";
public $icon = "ti-layout-width-full";
public function get_label() {
return esc_html__("Test element", "bricks");
@wplit
wplit / footer-scripts.html
Last active March 18, 2026 04:11
prevent tabbing to open toggle if header search open
@wplit
wplit / footer-scripts.html
Created March 15, 2026 22:19
listen for bricks' accordion item opening, when that happens re-run the readmore
@wplit
wplit / code.php
Created March 6, 2026 03:34
example custom function outputting two custom field values
<?php
function your_custom_function() {
$output = '<p>' . get_field( 'acf_field_one' ) . '</p>';
$output .= '<p>' . get_field( 'acf_field_two' ) . '</p>';
return $output;
};
@wplit
wplit / footer-scripts.html
Last active March 4, 2026 23:03
re-init readmore element when bricks tabs open
@wplit
wplit / footer-scripts.html
Created March 3, 2026 01:15
run the panorama init function when the popover opens
@wplit
wplit / code.php
Last active February 26, 2026 22:46
FluentCart Product Transaction Hash Lookup, add to child theme functions.php
<?php
/**
* FluentCart Product Transaction Hash Lookup
*
* @param int $product_id The product ID to check for
* @return string The transaction hash if product was just purchased
*/
function get_fluentcart_product_trx_hash( $product_id ) {