Skip to content

Instantly share code, notes, and snippets.

@romerocs
romerocs / extend-wordpress-image-settings.js
Created May 6, 2021 16:16
Extend image editing settings in the Wordpress Editor
(function ($, _) {
var media = wp.media;
var sizes = [
'100%'
];
media.events.on('editor:image-edit', function (data) {
var origImageDetails = media.view.ImageDetails;
media.view.ImageDetails = origImageDetails.extend({
<?php
/*
Plugin Name: WPS Custom Block Patterns
Description: Adds a custom block pattern to the Gutenberg block editor.
Version: 1.0
Author: Chris Romero
Author URI: https://cromero.io
*/
@romerocs
romerocs / webpack-ignore-font-files.js
Created February 20, 2020 20:34
Webpack config for resolving font files in css without copying to the dist folder
module.exports = {
module: {
rules: [
{
test: /.(otf|eot|ttf|woff|woff2|svg)(\?\S*)?$/,
loader: "file-loader",
options: {
publicPath: "../../",
name: "./[path][name].[ext]",
emitFile: false