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 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.
@wplit
wplit / footer-scripts.html
Created May 11, 2026 05:46
auto-scroll to expanded accordion/tab when expanded
@wplit
wplit / footer-scripts.html
Created May 11, 2026 01:07
change morelength on lightbox
@wplit
wplit / array.php
Last active May 1, 2026 03:18
Example looping through an 'event' post type, and then an acf repeater 'event_repeater' inside each event
<?php
function my_get_calendar_events() {
// Custom post type slug
$post_type = 'event';
// ACF field names (post-level)
$field_color = 'event_color';
$field_start = 'event_start_date';
@wplit
wplit / acf.json
Last active May 6, 2026 01:56
event acf fields
[
{
"key": "group_xcalendar_events",
"title": "Event Fields",
"fields": [
{
"key": "field_xcalendar_basic_info_tab",
"label": "Event Details",
"name": "",
"aria-label": "",
@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 May 14, 2026 05:44
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");