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 August 6, 2025 01:03
scroll user to opened accordion item (add to page settings > custom code > footer scripts)
@wplit
wplit / code.js
Created July 30, 2025 06:57
trigger timeout when modal opens
document.addEventListener('DOMContentLoaded', () => {
const observer = new MutationObserver((mutationsList) => {
for (const mutation of mutationsList) {
if (
mutation.type === 'attributes' &&
mutation.attributeName === 'class'
) {
const target = mutation.target;
@wplit
wplit / child-theme.php
Created July 30, 2025 00:40
custom function for gallery image count
<?php
function acf_gallery_count($field_name, $post_id = null) {
$gallery = get_field($field_name, $post_id);
$count = is_array($gallery) ? count($gallery) : 0;
return $count;
}
[General] - Support across all elements for Bricks' components feature.
[General] - Support using all elements inside nested components
[General] - Added 'component scope' option to all elements that control/target other elements.
[Media Player] - New nestable element for building custom video players.
[Media Player Audio] - New nestable element for building custom audio players.
[Media Control] - New controller element for adding control buttons to the media players
[Media Playlist] - New controller element for adding playlist items for the media players
[WP Menu Query] - Added support for custom field dynamic tags from menu items inside menu loop.
[WP Menu Query] - New tag for changing link targets as per individual menu item settings.
[Slide Menu] - Added option to replace sub menus with bricks' mega menu template for top menu items.
@wplit
wplit / footer-scripts.html
Created July 26, 2025 03:46
auto-close favorites popovers after 2000ms delay
@wplit
wplit / footer-scripts.html
Last active July 16, 2025 05:30
remove columns if found emty from dynamic table (add to page settings > custom code > footer scripts)
@wplit
wplit / code.php
Last active July 14, 2025 06:40
limit number of results in any query loop
<?php
add_filter( 'bricks/query/result', function ( array $result, object $query_obj ): array {
$element_id = 'ejmwod'; // Element ID with query loop
$result_count = 1; // How many results to output
if ( $query_obj->element_id !== $element_id ) {
return $result;
}
@wplit
wplit / footer-scripts.html
Created July 14, 2025 03:45
remove <template> where Bricks isn't removing
@wplit
wplit / footer-scripts.html
Last active July 8, 2025 11:13
invisible control if active slide has no caption
@wplit
wplit / footer-scripts.html
Created June 27, 2025 00:31
do copy to clipboard on popover opening