Skip to content

Instantly share code, notes, and snippets.

View bph's full-sized avatar

Birgit Pauli-Haack bph

View GitHub Profile
@bph
bph / cors-playground.php
Created November 17, 2023 10:35
cors policy on pantheon in mu-plugin
<?php
/*
Plugin Name: cors policy to allow playground
Plugin URI: icodeforapurpose.com
Description: Cors policy to allow playground to fetch the nightly gutenberg.zip.
Version: 0.1
Author: Birgit Pauli-Haack
Author URI: gutenbergtimes.com
*/
@bph
bph / psl-theme-test.txt
Last active October 19, 2023 15:21
Blocks for Themes Test
<!-- wp:paragraph -->
<p><a href="https://gist.github.com/bph/335ddef358bb41efdcd159cbc76f582e">https://gist.github.com/bph/335ddef358bb41efdcd159cbc76f582e</a></p>
<!-- /wp:paragraph -->
<!-- wp:heading {"className":"eplus-oOhLNH"} -->
<h2 class="eplus-oOhLNH">Common Blocks / Formatting / Layout Elements / Widgets and Embeds</h2>
<!-- /wp:heading -->
<!-- wp:list {"className":"eplus-eI3gin"} -->
<ul class="eplus-eI3gin"><li><a href="#images">Images</a> (Single image, cover image, gallery </li><li><a href="#quotes">Pull Quote / Quote</a></li><li><a href="#verse">Verse</a></li><li><a href="#buttons">Buttons</a></li><li><a href="#socialicons" data-type="internal" data-id="#socialicons">Social Icons</a></li><li><a href="#columns">Columns </a> Text (only) columns / Columns experimental</li><li><a href="#cover" data-type="internal" data-id="#cover">Cover</a> with CAT + button</li><li><a href="#paragraphs">Paragraph</a> </li><li><a href="#audio">Audio</a> </li><li><a href="#video">Video</a></li><li><a href="#w
@bph
bph / multipage-for-toc-test
Created March 11, 2022 12:56
test for TOC block
<!-- wp:paragraph -->
<p><a href="https://gist.github.com/bph/335ddef358bb41efdcd159cbc76f582e">https://gist.github.com/bph/335ddef358bb41efdcd159cbc76f582e</a></p>
<!-- /wp:paragraph -->
<!-- wp:group {"backgroundColor":"secondary"} -->
<div class="wp-block-group has-secondary-background-color has-background"><!-- wp:paragraph -->
<p><strong>Table of Contents</strong></p>
<!-- /wp:paragraph -->
<!-- wp:table-of-contents {"headings":[{"content":"Common Blocks / Formatting / Layout Elements / Widgets and Embeds","level":2,"link":null},{"content":"Images","level":2,"link":"http://testing-prs.local/testing-multiple-pages-and-toc-block/?page=2#images"},{"content":"Cover Image","level":2,"link":null},{"content":"Single Image","level":2,"link":null},{"content":"Image Gallery","level":2,"link":null},{"content":"Let's discuss the Page Break in Quotes","level":2,"link":"http://testing-prs.local/testing-multiple-pages-and-toc-block/?page=3#quotes"},{"content":"Verse Block","level":2,"link":"http://testing-prs.local/t
@bph
bph / gist:fa359f27b12f8e3a87ce36d03090dde3
Created July 14, 2021 20:54
Issue 33436 / gutenberg theme.json
{
"version": 1,
"settings": {
"layout": {
"contentSize": "800px",
"wideSize": "1000px"
},
"border": {
"customColor": false,
"customRadius": false,
@bph
bph / switch-states-sheets.txt
Created February 24, 2021 00:04
Switch Statement for Google Sheets - Replace US Statenames with 2-Letter Acroynym.
=SWITCH(TRIM(AQ2), "Alabama","AL", "Alaska","AK","Arizona", "AZ", "Arkansas","AR","California", "CA","Colorado", "CO", "Connecticut","CT","Delaware","DE","Florida", "FL", "Georgia", "GA", "Hawaii","HI","Idaho","ID", "Illinois","IL","Indiana","IN","Iowa", "IA", "Kansas","KS", "Kentucky","KY","Louisiana", "LA","Maine","ME", "Maryland", "MD","Massachusetts","MA", "Michigan", "MI", "Minnesota", "MN", "Mississippi","MS","Missouri","MO","Montana","MT","Nebraska","NE", "Nevada","NV", "New Hampshire", "NH","New Jersey", "NJ", "New Mexico", "NM","New York", "NY", "North Carolina", "NC", "North Dakota","ND", "Ohio","OH", "Oklahoma","OK", "Oregon", "OR", "Pennsylvania","PA", "Rhode Island", "RI", "South Carolina","SC","South Dakota", "SD", "Tennessee", "TN","Texas", "TX", "Utah", "UT", "Vermont","VT","Virginia","VA", "Washington", "WA", "West Virginia","WV","Wisconsin","WI","Wyoming","WY",Trim(AQ2))
@bph
bph / content-block-team-member.php
Created May 17, 2019 20:08
Example code for ACF building blocks
<?php
// create id attribute for specific styling
$id = 'team-member' . $block['id'];
// create align class ("alignwide") from block setting ("wide")
$align_class = $block['align'] ? 'align' . $block['align'] : '';
// Load values and asigning defaults for the block fields.
$short_bio = get_field('short_bio') ?: 'the short bio goes here... ';
$first_name = get_field('first_name') ?: 'First Name';
@bph
bph / team member theme's functions.php
Last active May 17, 2019 20:04
Example Code for using ACF building blocks
function register_acf_blocks() {
// register a team member block.
acf_register_block(array(
'name' => 'acf-team-member',
'title' => __('ACF Team Member'),
'description' => __('A custom team member block created via ACF 5.8'),
'render_template' => 'content-block-team-member.php',
'category' => 'formatting',
'icon' => 'admin-comments',
@bph
bph / block-team-member.php
Last active May 16, 2019 21:10
Block Lab: Team Member block display
<h2>
<?php block_field( 'first-name' );?>
<?php block_field( 'last-name' );?>
</h2>
<p><img class="teamphoto" src="<?php block_field( 'picture' ); ?>"
alt="<?php block_field( 'first-name' );?>
<?php block_field( 'last-name' );?> " width="150" style="float:left;padding:4px;margin;2px;"/>
<?php block_field( 'short-bio' ); ?></p>
<p><em>You can reach <?php block_field( 'first-name' );?></em>
{
"__file": "wp_block",
"title": "Cover image invitation",
"content": "<!-- wp:paragraph {\"align\":\"center\",\"customTextColor\":\"#ffffff\",\"backgroundColor\":\"luminous-vivid-orange\",\"customFontSize\":23} -->\n<p style=\"color:#ffffff;font-size:23px;text-align:center\" class=\"has-background has-luminous-vivid-orange-background-color\">Join your local WordPress Meetup!<br/></p>\n<!-- /wp:paragraph -->\n\n<!-- wp:cover-image {\"url\":\"http://rctesting.local/wp-content/uploads/2018/09/rawpixel-678089-unsplash-web.jpg\",\"id\":39,\"hasParallax\":true} -->\n<div class=\"wp-block-cover-image has-background-dim has-parallax\" style=\"background-image:url(http://rctesting.local/wp-content/uploads/2018/09/rawpixel-678089-unsplash-web.jpg)\"><p class=\"wp-block-cover-image-text\"><strong><strong><em>September, 20th at 6 pm ET<br/></em></strong><br/>Share your favorite Plugins &amp; Reusable Blocks for Content Creators<br/><em><br/>at VentureX, Mercato, Naples. </em></strong></p></div>\n<!-- /wp:cover-ima
@bph
bph / psl-theme-test.txt
Created June 22, 2018 10:53
Blocks for Themes Test
<!-- wp:heading -->
<h2>Common Blocks / Formatting / Layout Elements / Widgets and Embeds</h2>
<!-- /wp:heading -->
<!-- wp:list -->
<ul>
<li><a href="#images">Images</a> (Single image, cover image, gallery </li>
<li><a href="#quotes">Pull Quote / Quote</a></li>
<li><a href="#verse">Verse</a></li>
<li><a href="#buttons">Button</a></li>