Skip to content

Instantly share code, notes, and snippets.

View folbert's full-sized avatar

Björn Folbert folbert

View GitHub Profile
@folbert
folbert / bedrock-setup-guide.md
Last active October 16, 2023 11:08
How to get up and running with Bedrock and Bedrock Capistrano at Oderland

Getting up and running with Bedrock

If you get totally stuck, here are some resources that may help you: Roots Discourse. Actually, you may want to head over and read this through really quick. It's nowhere near as long as this and may be good to have in the back of your mind when reading the rest of this document. Capistrano Website with manual Screencast on deploying WordPress with Capistrano.

Bedrock?

Bedrock is created by the good awesome people behind Sage and is described as a "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure." Read more at https://roots.io/bedrock.

This is an attempt to describe how to pass data to Gutenberg InnerBlocks when using ACF and ACF Composer. I can not share complete code examples ATM since due to reasons that I can not affect.

We will be using Gutenbergs Context. It is not 100% straight forward or easy to explain but in short, a block can provide context to its inner blocks and use context that is passed down to it.

Disclaimer: I am writing this while focusing on other things so please forgive (and tell) me if anything is unclear. It probably helps if you have some deeper understanding of how ACF and ACF Composer works.

In order to do this you need to use ACF 6 which is in alpha 2 at the time of writing this.

ACF composer needs to be updated with the changes in [this commit](https://github.com/Log1x/acf-composer/c

@folbert
folbert / _display-bootstrap-size.scss
Last active December 29, 2021 17:43
Display current Bootstrap v4 size on screen
/*
Inspired by https://www.viget.com/articles/check-your-breakpoint-using-this-simple-css-snippet
*/
body:after {
color: #000;
font-family: Helvetica;
font-size: 12px;
padding: 5px;
font-weight: bold;
const mix = require('laravel-mix');
require('@tinypixelco/laravel-mix-wp-blocks');
require('laravel-mix-purgecss');
require('laravel-mix-copy-watched');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
/**
* Wait until ACF is ready
*/
acf.addAction('ready', function () {
ec_layout_titles_on_change();
});
/**
<?php
/**
* Deploy for Bedrock with Sage9 on Homestead.
* Loosely based on https://github.com/zorca/wp-deploy/blob/master/deploy.php.
*/
namespace Deployer;
require 'recipe/common.php';
# deploy.rb from https://github.com/roots/bedrock-capistrano modified by Björn Folbert, https://gist.github.com/folbert/
# Folbert-comment: from Capistrano doc:
# Here we'd set the name of the application, must be in a format that's safe for
# filenames on your target operating system.
set :application, 'APPLICATIONNAME'
# Folbert-comment: use the SSH url for the repo from GitHub
set :repo_url, 'git@github.com:USER/REPO.git'
@folbert
folbert / Bootstrap overrides for Sage 8.5.1 and Bootstrap 4 alpha 6
Last active April 24, 2019 00:00
Add this to bower.json and remove what you don't need
"overrides": {
"bootstrap": {
"main": [
"./scss/_variables.scss",
"./scss/_mixins.scss",
"./scss/_custom.scss",
"./scss/_normalize.scss",
"./scss/_print.scss",
"./scss/_reboot.scss",
"./scss/_type.scss",
@folbert
folbert / togglable-acf-description.php
Created February 23, 2017 08:14
Toggleable description for Advanced Custom Fields
<?php
/**
* Hide ACF descriptions that have more characters than you deem feasible to display directly.
* Change the fewbricksToggleableDescriptionMinCharLength variable to 0 if you want all descriptions
* to be hidden.
* At its most simple, place this code in functions.php. But you should really try to use some namespacing
* or OOP approach to it instead.
*/