Skip to content

Instantly share code, notes, and snippets.

View josephfusco's full-sized avatar
:octocat:
Building the web

Joe Fusco josephfusco

:octocat:
Building the web
View GitHub Profile
#!/usr/bin/env bash
# Exit if WP-CLI is not available.
if ! command -v wp &> /dev/null
then
echo "This script requires WP-CLI"
exit
fi
# Install WordPress plugins.
@josephfusco
josephfusco / CustomToolbar.tsx
Last active February 24, 2023 18:04
Testing the ToolbarNodeSkeleton component with Faust.js.
import React from 'react';
import { FaustHooks, FaustPlugin } from '@faustwp/core';
import { FaustToolbarNodes, ToolbarNodeSkeleton } from '@faustwp/core/toolbar';
export class CustomToolbar implements FaustPlugin {
apply(hooks: FaustHooks) {
hooks.addFilter('toolbarNodes', 'faust', (toolbarNodes: FaustToolbarNodes) => {
const customToolbarNodes: FaustToolbarNodes = [
{
<iframe id="wp-playground" style="width: 100%; height: 100%" frameBorder="0"></iframe>
<script type="module">
import {
startPlaygroundWeb
} from 'https://unpkg.com/@wp-playground/client/index.js';
const client = await startPlaygroundWeb({
iframe: document.getElementById('wp-playground'),
remoteUrl: `https://playground.wordpress.net/remote.html`,
blueprint: {
landingPage: '/wp-admin/options-general.php?page=faustwp-settings',