Skip to content

Instantly share code, notes, and snippets.

@skyshab
skyshab / example.php
Last active August 2, 2021 15:28
change the responsive breakpoints for the v2 calendar views
<?php
add_filter( "tribe_events_views_v2_view_breakpoints", function($breakpoints){
return [
'xsmall' => 500,
'medium' => 768,
'full' => 960,
];
});
@skorasaurus
skorasaurus / gist:a01249d4302226bf12c80dd979322303
Last active April 20, 2024 20:44
recap of Issue 6177. This document was first written in February 2021, last updated 2023-10-08)

The issue - WordPress/gutenberg#6177 is one of the most discussed issues in the Gutenberg project but its discussion is overwhelming and progress has stagnated.

Since the issue was first written in April 2018, the block editor and WordPress have changed and improved but many improvements to improve displaying images remain.

This document summarizes the remaining deficiencies of image loading mentioned in WordPress/gutenberg#6177

At its core (pun intended), the primary issue is: larger than necessary images (by pixel size (dimensions)) and as well as higher resolution than necessary, are loaded for an end user when they visit a page with images.

This behavior occurs when WordPress' and a theme's usual defaults (e.g. no alignment specificed, default image size created) are used.

@strarsis
strarsis / guide.md
Last active April 17, 2025 18:36
Object caching with Bedrock (and Trellis) using Redis

Object caching with Bedrock (and Trellis) using Redis

What is object caching

While nginx microcaching already solves page caching (as of static, rarely changing WordPress pages), the performance for dynamically generated pages (like WooCommerce shop pages and admin backend in general) can benefit greatly from additionally using an object cache. Object caching allows an application (in this case WordPress with its plugins, theme, etc.) to store prepared objects (mostly database queries) in a database and quickly retrieve them, therefore improving the performance of dynamic page generation. Object caching is (usually) transparent, which means that it shouldn't be noticeable by users and developers (except for the performance improvements of course).

Implementations

@mrwweb
mrwweb / readme.md
Last active September 27, 2024 22:29
The Events Calendar v2 Template Reset & Customizations - Now on Github
@doubleedesign
doubleedesign / widget-product-categories.php
Created January 17, 2021 06:27
Override the output of the WooCommerce product categories widget to be a Bootstrap accordion
<?php
/**
* Product Categories Widget
* Modifies the WooCommerce product categories widget to display as a Bootstrap accordion.
*
* @package WooCommerce/Widgets
* @version 2.3.0
*/
defined( 'ABSPATH' ) || exit;
@markhowellsmead
markhowellsmead / full-codes.js
Created January 16, 2021 15:51 — forked from phpbits/full-codes.js
Extend core Gutenberg blocks with custom attributes and settings. View full tutorials here : https://jeffreycarandang.com/extending-gutenberg-core-blocks-with-custom-attributes-and-controls/
/**
* External Dependencies
*/
import classnames from 'classnames';
/**
* WordPress Dependencies
*/
const { __ } = wp.i18n;
const { addFilter } = wp.hooks;
@Achterstraat
Achterstraat / Directadmin.sh
Created January 11, 2021 16:13
Accounts overview included domains, subdomains, pointers and mailaliases in tabbed list!
#!/bin/sh
if [ ! -z "${1}" ]; then user="${1}"; else user=""; fi
users=/usr/local/directadmin/data/users
virtual=/etc/virtual
for u in `ls ${users}/*/users.list`;
do
r=`echo ${u} | cut -d/ -f7`
if [ -z "${user}" ]; then echo -e "R: ${r}"; fi
for u in `cat ${u}; echo ${r}`;
@wir
wir / Accessibility Panel - JS Controls
Created October 23, 2020 12:06 — forked from DougCrossDesign/Accessibility Panel - JS Controls
Accessibility Panel - JS Controls
Accessibility Panel - JS Controls
---------------------------------
Converted Wordpress Plugin Example of an Accessibility Panel made with Javascript to control visual design of a HTML / CSS for users with visual disabilities to explore the content. This example is scalable for any layout based on which targets are bing using for the containers, text and link variables.
A [Pen](https://codepen.io/DougCrossDesign/pen/RjyaYZ) by [Doug Cross](https://codepen.io/DougCrossDesign) on [CodePen](https://codepen.io).
[License](https://codepen.io/DougCrossDesign/pen/RjyaYZ/license).
@MWDelaney
MWDelaney / facetwp-bootstrap-checkboxes.php
Last active November 30, 2021 16:33
Replace FacetWP checkboxes with Bootstrap custom checkbox markup.
<?php
/**
* Replace FacetWP default HTML output for "Checkboxes" with Bootstrap custom checkbox markup
*/
add_filter('facetwp_facet_html', function ($output, $params) {
// Check that this facet is a "checkboxes" type facet before proceeding.
if ('checkboxes' == $params['facet']['type']) {
// Initialize variables
<x-layout>
<x-slot name="head">
<x-social-media-meta
title="Blade Component Examples"
description="Learn about all sorts of Blade component tips and tricks."
image="https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg"
card="summary"
/>
</x-slot>