Skip to content

Instantly share code, notes, and snippets.

View wpeasy's full-sized avatar

Alan Blair wpeasy

  • WPEasy Pty Ltd
  • Brisbane Australia
View GitHub Profile
@wpeasy
wpeasy / pointer-tracker.json
Last active December 19, 2023 00:27
JSON template for Bricks Pointer Tracker
{"content":[{"id":"pqqtzn","name":"section","parent":0,"children":["fdayxr","mixfao"],"settings":{},"label":"Code"},{"id":"fdayxr","name":"code","parent":"pqqtzn","children":[],"settings":{"code":"<script>\n/* Use this script to track status of any scripts\nThis is to ensure we don't ruun multiple times when code\nis run from Bricks Code Elements \nIdeally, all code shoule be moved to a Code Manager. By doing\nso, this control is not needed.\n*/\n((d) => {\n if (undefined === d.bbStatus) {\n let bbStatus = {};\n /* If flag is already set, return false\n Otherwise, set the flag and return true */\n const setStatus = (flag, value) => {\n if (undefined !== bbStatus[flag]) {\n return false;\n } else {\n bbStatus[flag] = value;\n return true;\n }\n }\n const getStatus = flag => {\n return bbStatus[flag];\n }\n const clearStatus = flag => {\n delete bbStatus[
@wpeasy
wpeasy / wpe-framework.scss
Last active December 19, 2023 18:50
WPE Framwork
/*###############################
SCSS VARIABLES
################################*/
$one-rem-in-px: 10px;
$clamp-vp-min: 480px;
$clamp-vp-max: 1600px;
$use-fluid-size: "on";
$use-fluid-headings: "on";
$use-fluid-text: "on";
@wpeasy
wpeasy / functions.php
Created October 2, 2023 00:20
WS Form fields to Thank You
<?php
function get_wsf_submission_by_url_hash(){
static $submission;
if(!isset($_GET['hash'])) return 'No Hash URL parameter';
if(!$submission){ $submission = wsf_submit_get_by_hash($_GET['hash']); }
return $submission;
}
function fetch_wsf_submission_field($field_id) {
@wpeasy
wpeasy / main.css
Created October 1, 2023 00:57
Grouping WordPress CPTs
#adminmenu [id*="menu-posts-"]{
background-color: var(--bricks-color-primary);
}
#adminmenu [id*=menu-posts-] > a {
color: black;
}
#adminmenu [id*=menu-posts-] > a .wp-menu-image::before{
color: black;
}
@wpeasy
wpeasy / metaboc-to-atts
Created September 17, 2023 00:14
& Metabox Automagical Data Atts
<?php
/*
In Bricks Attributes -> Name - insert {echo:mb_data_atts}
Don't put anything in the Value field
*/
function mb_data_atts(){
$fields = get_post_meta(get_the_ID());
$out = "";
@wpeasy
wpeasy / acss-overrides.scss
Created September 1, 2023 00:04
ACSS Text Line Lengths Override
$sizes: ('xxl','xl','l','m','s','xs');
.brx-body{
@each $size in $sizes {
.text--#{$size} {
max-inline-size: var(--text-#{$size}-length);
}
}
}