Skip to content

Instantly share code, notes, and snippets.

@grzesiek1owline
grzesiek1owline / wp-perf.md
Created February 5, 2023 00:29 — forked from Ruzgfpegk/wp-perf.md
WordPress Performance & Development tips
<?php
/**
* Put this into your functions.php of your child-theme or custom plugin
* you can create the role with wp-cli by running `wp shell` and running the command:
* add_role('merchant','Merchant',array('read' => true, 'delete_posts' => false) );
*/
/**
* Step #1: create the field used to store the new sale_price for product_variation and for products
*/
@grzesiek1owline
grzesiek1owline / .lando.yml
Created June 28, 2022 22:14 — forked from MatthieuScarset/.lando.yml
Lando (+3.0) with XDebug (WordPress recipe)
name: wordpress
recipe: wordpress
services:
appserver:
webroot: .
xdebug: debug
config:
php: .vscode/php.ini
tooling:
install:wordpress:
@grzesiek1owline
grzesiek1owline / tailwind.config.js
Created April 3, 2022 10:41 — forked from alexstandiford/tailwind.config.js
WordPress theme.json that extends Tailwind CSS configs
const fs = require( 'fs' )
const themeJson = fs.readFileSync( './theme.json' )
const theme = JSON.parse( themeJson )
const colors = theme.settings.color.palette.reduce( ( acc, item ) => {
const [color, number] = item.slug.split( '-' )
// If there is a number identifier, make this an object
if(undefined !== number) {