Skip to content

Instantly share code, notes, and snippets.

Simon Prosser Pross

Block or report user

Report or block Pross

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Pross
Pross / css.css
Created Jun 24, 2019
Disable row shapes in ie11
View css.css
body.fl-builder-ie-11 div.fl-builder-shape-layer {
display:none;
}
View functions.php
<?php // ignore this line, its only to make highlighting work
add_filter( 'fl_builder_render_module_content', function( $out, $module ) {
if ( 'heading' === $module->slug ) {
$string = $out;
$find = ' ';
$replace = '&nbsp;';
$out = strrev( preg_replace( strrev( "/$find/" ), strrev( $replace ), strrev( $string ), 1 ) );
}
return $out;
}, 10, 2);
View wpcli.diff
From b7f4b3d6aca25bd21495a35e620b642931af0e21 Mon Sep 17 00:00:00 2001
From: Simon Prosser <pross@pross.org.uk>
Date: Thu, 11 Apr 2019 17:30:38 +0100
Subject: [PATCH] Fix wp-cli in PHP 5.4 and below.
list is a protected function even though we are in a class.
---
classes/class-fl-builder-wpcli-command.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
View functions.php
/**
* dequeue FA4
*/
add_action( 'wp_print_styles', function() {
wp_dequeue_style( 'font-awesome' );
} );
@Pross
Pross / js.js
Created Jan 21, 2019
How to paste random jQuery from the internet.
View js.js
(function($){
$(document).ready(function(){
// This runs on ready function
// Add Copy+Pasta here
});
})(jQuery);
@Pross
Pross / config.json
Created Dec 17, 2018
Minimal bs3 config file.
View config.json
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
View gist:ae7f81249c5f61b33fd06c2a35284ad9

Allow Beaver Builder to update to 2.2 from 2.1 before auto updates are enabled.

To start with auto updates are disabled when 2.2 is released and you have to update manually by downloading the zip from your account area. With this simple file edit you can let WP do the update as if auto updates were enabled.

!Caution! Please make sure you do a backup before ANY WP plugin updates

View typo.diff
diff --git a/core/modules/class-module-page-cache.php b/core/modules/class-module-page-cache.php
index e48fda9..cd981e8 100644
--- a/core/modules/class-module-page-cache.php
+++ b/core/modules/class-module-page-cache.php
@@ -1122,7 +1122,7 @@ class WP_Hummingbird_Module_Page_Cache extends WP_Hummingbird_Module {
// Reset cached pages count.
WP_Hummingbird_Settings::update_setting( 'pages_cached', 0, 'page_cache' );
- self::log_msg( 'Cache direcotry purged' );
+ self::log_msg( 'Cache directory purged' );
View functions.php
<?php // added for highlighting
add_filter( 'wp_kses_allowed_html', function ( $allowedposttags, $context ) {
if ( $context == 'post' ) {
$allowedposttags['input']['value'] = 1;
}
return $allowedposttags;
}, 10, 2 );
View functions.php
<?php // added for syntax highlighting.
add_shortcode( 'coauthors', 'coauthors_func' );
function coauthors_func( $atts ) {
$atts = shortcode_atts( array(
'between' => null,
'betweenLast' => null,
'before' => null,
'after' => null,
), $atts, 'coauthors' );
You can’t perform that action at this time.