Skip to content

Instantly share code, notes, and snippets.

View Xilonz's full-sized avatar

Arjan Steenbergen Xilonz

View GitHub Profile
@Xilonz
Xilonz / main.yml
Last active April 4, 2020 17:01
Sync-back WordPress plugin from Satis
name: Update Plugin
on:
pull_request
jobs:
sync_plugin:
name: Sync-back plugin
runs-on: ubuntu-latest
steps:
@Xilonz
Xilonz / bedrock-satispress.php
Last active March 17, 2020 10:36
Bedrock SatisPress MU-Plugin
<?php
/**
* Plugin Name: Bedrock StatisPress
* Plugin URI: https://steenbergen.design
* Description: An MU Plugin that ties Bedrock and SatisPress together. Allows for autoupdates and cleans up the admin dasboard.
* Version: 1.0.0
* Author: Steenbergen Design
* Author URI: https://steenbergen.design
* License: MIT License
*/
@Xilonz
Xilonz / bedrock-satispress.php
Created February 29, 2020 15:03
SatisPress Bedrock MU Plugin
<?php
/**
* Plugin Name: Bedrock StatisPress
* Plugin URI: https://steenbergen.design
* Description: An MU Plugin that ties Bedrock and SatisPress together. Allows for autoupdates and cleans up the admin dasboard.
* Version: 1.0.0
* Author: Steenbergen Design
* Author URI: https://steenbergen.design
* License: MIT License
*/
@Xilonz
Xilonz / main.yml
Created October 30, 2019 22:48
Roots Trellis Github Actions Example
name: Deploy
on: [push]
jobs:
deploy_staging:
name: deploy to staging
runs-on: ubuntu-latest
container:
image: itinerisltd/tiller:latest
@Xilonz
Xilonz / field.php
Created June 21, 2019 11:13
Sage 9 Carbon Field Blocks
<?php
namespace App;
use Carbon_Fields\Field;
use Carbon_Fields\Block;
Block::make( __( 'Gutenberg Block' ) )
->set_icon( 'format-chat')
->add_fields( array(
Field::make( 'rich_text', 'text', __( 'text', 'my-theme' ) )
@Xilonz
Xilonz / bedrock-autoloader.php
Created June 10, 2019 14:24
Bedrock Autoloader compatable with symlinked plugins directory
<?php
/**
* Plugin Name: Bedrock Autoloader
* Plugin URI: https://github.com/roots/bedrock/
* Description: An autoloader that enables standard plugins to be required just like must-use plugins. The autoloaded plugins are included during mu-plugin loading. An asterisk (*) next to the name of the plugin designates the plugins that have been autoloaded.
* Version: 1.0.0
* Author: Roots
* Author URI: https://roots.io/
* License: MIT License
*/
@Xilonz
Xilonz / helpers.php
Created January 16, 2019 09:42
Use Sage (and blade) with Carbon Fields
function get_block_template( $template, $args ){
$template = App\locate_template([$template.".blade.php", 'resources/views/partials/blocks/'.$template.'.blade.php']);
$data = collect(get_body_class())->reduce(function ($data, $class) use ($template) {
return apply_filters("sage/template/{$class}/data", $data, $template);
});
/*
* This merges data available in blade templates with data from carbon fields as ${meta_key}
@Xilonz
Xilonz / __mixins.scss
Created January 7, 2019 18:00
Bootstrap 4: Allow for more columns than grid-columns
// Define $total-columns in variables.
// This is usefull for horizontal scrolling purposes.
@mixin make-grid-columns($columns: $total-columns, $width: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) {
// Common properties for all breakpoints
%grid-column {
position: relative;
width: 100%;
padding-right: $gutter / 2;
padding-left: $gutter / 2;
@Xilonz
Xilonz / setup.php
Created February 27, 2018 10:50
Sage Wordpress Query Loop for Blade templates
/**
* Add this to your setup.php
* Usage @loop( $wp_query ) or $loop and end with @endloop
* the new $loop variable is available
*/
/**
* Create @loop Blade directive
*/
sage('blade')->compiler()->directive('loop', function ( $query = null ) {