Skip to content

Instantly share code, notes, and snippets.

Avatar
🌵

Shaun Baer baerkins

🌵
View GitHub Profile
View development.services.local.yml
# Local development services.
#
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
parameters:
http.response.debug_cacheability_headers: true
twig.config:
debug: true
auto_reload: true
cache: false
@baerkins
baerkins / settings.local.php
Last active Nov 13, 2018
Local Drupal 8 Settings
View settings.local.php
<?php
/**
* SAVE FILE TO:
* `[PROJECT_BASE]/web/sites/default`
*
*/
/**
* Enable local development services.
@baerkins
baerkins / modal.css
Last active Aug 24, 2018
Accessible Modal with JS
View modal.css
body.is-locked {
height: 100%;
overflow: hidden;
}
.modal {
display: none;
}
.modal--is-open {
@baerkins
baerkins / auto-gen-taxonomy-term.php
Last active Feb 6, 2018
Auto-generate a taxonomy term when a post is created
View auto-gen-taxonomy-term.php
<?php
/**
* Auto Gen Project Agency Taxonomy when an agency is created
* @link https://gist.githubusercontent.com/brenna/7377802/raw/a5092e5b4bd2a094a6534d73e9f2f81f26783744/wp-autopopulate-taxonomy
*
*/
function FS__Update_Project_Agency_Terms($post_id) {
// Only update terms if it's the post type we want
View Tribe_Event_Functions.php
<?php
namespace Apollo\Extend\TribeEvents;
// Functions to extend the Events Calendar plugin
// https://theeventscalendar.com/
// Note: it's a rag tag bunch of functions, use are your own risk.
/**
View GForms_Functions.php
<?php
/**
* Custom Gravity Forms Spinner
*
* @since 1.0.0
*/
add_filter( 'gform_ajax_spinner_url', 'spinner_url', 10, 2 );
function spinner_url( $image_src, $form ) {
View ACF_Functions.php
<?php
// Add ACF Options Menu
if ( function_exists("acf_add_options_page") ) {
acf_add_options_page();
}
if ( function_exists("register_options_page") ) {
register_options_page( 'Global Options' );
register_options_page( 'Page Options' );
}
@baerkins
baerkins / yoast
Created Jun 29, 2017 — forked from aderaaij/yoast
Wordpress - Move yoast seo boxes to bottom of post/page
View yoast
// Move Yoast to bottom
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
@baerkins
baerkins / calendar.md
Last active Jun 28, 2017
Tribe Event Calendar Content Options
View calendar.md

Calendar Event Content Options

There are many variables at play when events are created. This is a list of content pieces that Tribe Events can output by default:

Basic Data

  • Title
  • Content
  • Featured Image
  • Event Category
  • Tags
View lib-tribe-events.php
/**
* Allow past events to be queried in ACF Post Object
* Add 'custom' to query as per tribe_get_events();
*
* @link https://theeventscalendar.com/knowledgebase/using-tribe_get_events/
*/
function my_relationship_query( $args, $field, $post ) {
$args['eventDisplay'] = 'custom';