Skip to content

Instantly share code, notes, and snippets.

@louwie17
louwie17 / custom-product-type-example.php
Last active April 3, 2024 16:45
Custom product type example
<?php
/**
* Plugin Name: Custom Product Type Example
* Description: Custom Product Type Example
* Version: 0.1.0
* Requires at least: 6.2
* WC requires at least: 8.7
* Requires PHP: 7.4
* Author: The WordPress Contributors
* License: GPL-3.0+
@louwie17
louwie17 / blocks.js
Created April 28, 2023 09:55
Gutenberg blocks content only re-rendering example
( function ( blocks, element, blockEditor ) {
var el = element.createElement;
blocks.registerBlockType( 'gutenberg-examples/content', {
title: 'Test',
edit: function () {
element.useEffect(() => {
console.log('rendered content');
return () => {
console.log('removed content');
@louwie17
louwie17 / inbox-notifications.json
Last active September 7, 2022 18:57
Inbox notification json with link to external WP Admin
[
{
"slug": "external_wp_admin_link",
"type": "info",
"status": "unactioned",
"is_snoozable": 0,
"source": "gist.github.com",
"locales": [
{
"locale": "en_US",