Skip to content

Instantly share code, notes, and snippets.

View ndiego's full-sized avatar

Nick Diego ndiego

View GitHub Profile
@ndiego
ndiego / playground-experiment.json
Last active April 19, 2024 21:22
Playground experiment
{
"landingPage": "/wp-admin/site-editor.php",
"preferredVersions": {
"php": "8.0",
"wp": "beta"
},
"features": {
"networking": true
},
"steps": [
@ndiego
ndiego / block-hooks-api-examples-2-4.json
Created March 25, 2024 12:24
Block Hooks API - Examples 2 and 4
{
"landingPage": "/wp-admin/site-editor.php",
"preferredVersions": {
"php": "8.0",
"wp": "nightly"
},
"features": {
"networking": true
},
"steps": [
@ndiego
ndiego / block-hooks-api-examples-1-3.json
Last active March 25, 2024 12:23
Block Hooks API - Examples 1 and 3
{
"landingPage": "/wp-admin/site-editor.php?postType=wp_template&postId=twentytwentyfour%2F%2Fsingle",
"preferredVersions": {
"php": "8.0",
"wp": "nightly"
},
"features": {
"networking": true
},
"steps": [
@ndiego
ndiego / block-hooks-demo.php
Last active March 22, 2024 20:39
Block Hooks Demo
<?php
/**
* Plugin Name: Block Hooks Demo
* Description: Block Hooks API experiments.
* Version: 0.1.0
* Requires at least: 6.5
*/
defined( 'ABSPATH' ) || exit;
@ndiego
ndiego / block-variations-frost
Last active March 11, 2024 18:12
block-variations-frost
/**
* Add the following to a theme's functions.php file.
*/
function example_enqueue_block_variations() {
wp_enqueue_script(
'frost-enqueue-block-variations',
get_template_directory_uri() . '/assets/js/variations.js',
array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' )
);
@ndiego
ndiego / column-classes-default.css
Last active November 30, 2023 17:35
Column Classes - Built off the base column classes originally supplied in the Genesis Framework with fifths added.
/**
* Column Classes
*
* Width: 100%
* Gutter: 2.5641025641%
* Link: http://www.nickdiego.com/plugins/column-class-builder/
----------------------------------------------------------------------------- */
.five-sixths,
.four-fifths,
@ndiego
ndiego / my-pattern-library
Last active November 30, 2023 17:34
My Pattern Library
<?php
/**
* Plugin Name: My Pattern Library
* Description: A simple library of block patterns.
* Version: 0.1.0
* Requires at least: 5.8
* Requires PHP: 7.0
* Author: Your Name
* License: GPL v2 or later
* Text Domain: my-pattern-library
@ndiego
ndiego / sticky-block.html
Created October 25, 2016 23:38
Sticky Block - js + CSS
<script type="text/javascript">
jQuery(document).ready(function($) {
// Only enable when the screen size is large enough for a sidebar
if ( $(window).width() > '1024' ) {
// Fix the block if our scroll position is below the top of the page - 1px to make transition more fluid.
var top = $('.sticky').offset().top - 1;
$(window).scroll(function(e) {
@ndiego
ndiego / testimonial-block-pattern-with-locked-blocks
Last active May 19, 2023 15:24
Testimonial Block Pattern with Locked Blocks
<?php
/**
* Title: Testimonials
* Slug: twentytwentytwo/testimonials
* Categories: columns
* Block Types: core/post-content
* Post Types: page
*/
?>
@ndiego
ndiego / export-github-labels.js
Last active April 12, 2023 11:58
Export Github Labels
/*
Purpose: Export the configuration settings for GitHub Labels.
(c) James Perrin, MIT License, https://www.countrydawgg.com, | @jamesperrin
Modified to pull additional label info from the Gutenberg repo by @ndiego
Exporting Instructions:
1. Open a web browser.
2. Navigate to the desired GitHub repository.
3. Navigate to Issues tab.