Skip to content

Instantly share code, notes, and snippets.

View MWDelaney's full-sized avatar

Michael W. Delaney MWDelaney

View GitHub Profile
@ThatGuySam
ThatGuySam / allowed-block-types.php
Last active October 31, 2023 08:06
Limit allowed Gutenberg Blocks with full list of native Wordpress Blocks
<?php
// Hook up function to allowed_block_types filter
add_filter( 'allowed_block_types', 'set_allowed_block_types' );
/**
* Set allowed gutenburg block types
* https://rudrastyh.com/gutenberg/remove-default-blocks.html
*/
@freshyill
freshyill / .eleventy.js
Last active April 13, 2022 14:38
YouTube Editor component for Netlify CMS
module.exports = function(eleventyConfig) { // This only happens once in your template!
// Blah blah, whatever other Eleventy stuff you need.
eleventyConfig.addLiquidShortcode("youtube", (youtubeId, aspectRatio) => {
return `<div class="aspect-ratio" style="--aspect-ratio: ${aspectRatio}"><iframe class="youtube-player video video--youtube" src="https://www.youtube.com/embed/${youtubeId}/" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>`;
});
// Blah blah, whatever other Eleventy stuff you need.
@bdmason
bdmason / using-sage-9-blade-templates-for-woocommerce.md
Last active October 26, 2022 10:48
Using Sage 9 blade templates for WooCommerce

Using Sage 9 blade templates for WooCommerce

Declare WooCommerce theme support

Open app/setup.php, find the after_setup_theme action and put add_theme_support('woocommerce'); inside the function.

Override the plugin templates

Add the templates you want to override in resources/woocommerce:

theme    
│
@wpscholar
wpscholar / .eslintignore
Last active March 14, 2022 10:21
Webpack 4 Config for WordPress plugin, theme, and block development
**/*.min.js
**/*.build.js
**/node_modules/**
**/vendor/**
build
coverage
cypress
node_modules
vendor
@lukecav
lukecav / functions.php
Created April 13, 2018 13:44
Prevent the IP address being saved in the entry in Gravity Forms
add_filter( 'gform_ip_address', '__return_empty_string' );
@fastlinemedia
fastlinemedia / fl_builder_icon_sets.php
Created July 24, 2017 23:01
Using the fl_builder_icon_sets filter to add custom icon fonts to Beaver Builder
function my_custom_icons( $sets ) {
$path = get_stylesheet_directory() . '/my-custom-icons/';
$url = get_stylesheet_directory_uri() . '/my-custom-icons/';
$data = json_decode( file_get_contents( $path . 'selection.json' ) );
$icons = array();
foreach ( $data->icons as $icon ) {
$prefs = $data->preferences->fontPref;
@mburakerman
mburakerman / package.json
Last active September 26, 2022 17:32
Webpack 4 config.js (SCSS to CSS and Babel) 👌 The Simplest Usage 👌
{
"name": "webpack-sass",
"version": "1.0.0",
"scripts": {
"start": "webpack-dev-server --open --mode development",
"build": "webpack -p"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
@tony-caffe
tony-caffe / Contract Killer 3.md
Last active March 3, 2024 14:50 — forked from malarkey/Contract Killer 3.md
The latest version of Bytes Unlimited ‘Contract Killer’ for web professionals

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Revised by Bytes Unlimited : Feb 3rd 2020

@abrudtkuhl
abrudtkuhl / plugin.php
Created March 21, 2016 20:38
WordPress REST API - Get Random Post endpoint
<?php
/**
* Plugin Name: WP Slack REST API Backend
* Description: An example of using the WordPress REST API as a backend for a Slack Bot
* Author: Andy Brudtkuhl
* Author URI: http://youmetandy.com
* Version: 0.1
* Plugin URI: https://github.com/abrudtkuhl/heykramer
* License: GPL2+
@louim
louim / uploads.yml
Last active December 23, 2022 14:20
Drop-in playbook for Trellis to push and pull uploads from the server to your local machine.
---
- name: Sync uploads between environments
hosts: web
remote_user: "{{ web_user }}"
vars:
project: "{{ wordpress_sites[site] }}"
project_root: "{{ www_root }}/{{ site }}"
tasks: