Skip to content

Instantly share code, notes, and snippets.

View timelsass's full-sized avatar
🦠

Tim Elsass timelsass

🦠
View GitHub Profile
@timelsass
timelsass / TODO.md
Last active March 6, 2019 23:36
readme specs and standards
  • Add documentation covering format for resources that specify split licenses.
  • Work on new format for resource documentation. The current draft is length when comma space delimited. Something following suit with the Changelog section might be ideal. Example:
= resource.js 1.2.0 =               // Resource and version on a single line.
- assets/js/front-end-bundle.js     // Path where resource is used.
- (c) 2019 Copyright Holder         // Copy notice
- GPL-v-2-or-later                  // License identifier/name.
THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THE BOLDGRID THEME FRAMEWORK PRODUCT.
-----
The following software may be included in this product: @babel/runtime. A copy of the source code may be downloaded from https://github.com/babel/babel/tree/master/packages/babel-runtime. This software contains the following license and notice below:
MIT License
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
@timelsass
timelsass / disable-primary-menu-collapse.php
Created January 31, 2019 19:46
Disables Primary Menu Collapse for BoldGrid Theme Framework v1 based themes.
<?php
/**
* Plugin Name: Disable Primary Menu Collapse
* Description: Disables Primary Menu Collapse for BoldGrid Theme Framework v1 based themes.
* Plugin URI: https://gist.github.com/timelsass/d73c54b9f89a55e4a0d0dffbce50e625
* Author: Tim Elsass
* Author URI: tim.ph
*/
/**
@timelsass
timelsass / wpse318816-editor-access.php
Created November 10, 2018 02:58
Gives an example of how to allow editor role access to use siteimprove plugin.
<?php
/**
* Plugin Name: WPSE318816 Editor Access
* Description: Gives an example of how to allow editor role access to use siteimprove plugin. See https://wordpress.stackexchange.com/questions/318816/adding-menu-item-to-wordpress-admin-bar-for-editors-to-edit-one-plugins-setting.
* Plugin URI: https://gist.github.com/timelsass/87b24de86a9cce6633bbc55ed4213a5f
* Author: Tim Elsass
* Author URI: tim.ph
*/
// Checks if the current user is an editor role.
@timelsass
timelsass / wpse313731-custom-notification.js
Last active September 10, 2018 01:41
Add a global error notification to the customizer's main panel.
( function( $ ) {
'use strict';
wp.customize.bind( 'ready', function () {
wp.customize.notifications.add(
'wpse313731-custom-notification',
new wp.customize.Notification(
'wpse313731-custom-notification', {
dismissible: true,
@timelsass
timelsass / wpse313731-custom-message.css
Created September 10, 2018 00:24
Add a custom message to the customizer's main panel above the controls.
#customize-theme-controls .control-panel-themes.wpse313731-has-custom-message {
margin-bottom: 15px;
}
#customize-theme-controls .control-panel-themes.wpse313731-has-custom-message > .accordion-section-title {
margin-bottom: 0;
}
#customize-theme-controls .control-panel-themes.wpse313731-has-custom-message .wpse313731-custom-message {
background: white;
border-bottom: 1px solid #ddd;
padding: 10px 12px 10px 12px;
@timelsass
timelsass / functions.php
Created June 8, 2018 21:40
Example of changing Kirki's inline CSS priority to load before all styles.
<?php
/**
* Child theme functions.php
*
* @since 1.0.0
*/
// Enqueue kirki generated inline CSS first.
add_filter( 'kirki_config', function( $config ) {
$config['styles_priority'] = 1;
@timelsass
timelsass / page-something-new.php
Created June 8, 2018 21:13
Example page template
<?php
/**
* Template Name: Something New
*
* Template for something new pages.
*/
while ( have_posts() ) : the_post();
echo '<div><p>I\'m a template!</p></div>';
endwhile; // end of the loop.
@timelsass
timelsass / example.php
Created May 3, 2018 18:37
Add animate.css and WOW.js for content built with boldgrid page and post builder
<?php
function crio_config( $config ) {
if ( ! is_plugin_active( 'boldgrid-editor/post-and-page-builder.php' ) ) {
$config['scripts']['animate-css'] = true;
$config['scripts']['wow-js'] = true;
}
}
add_filter( 'boldgrid_theme_framework_config', 'crio_config', 11 );
new ( function() {
var ext = this
list = [],
generated = false;
ext._shutdown = function() {};
ext._getStatus = function() {
return {
status: 2,