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 // 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' );
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(-)
@Pross
Pross / functions.php
Created Jul 17, 2018
Font Awesome Five.
View functions.php
add_action( 'wp_enqueue_scripts', function() {
wp_enqueue_style( 'font-awesome-5' );
} );
View functions.php
/**
* dequeue FA4
*/
add_action( 'wp_print_styles', function() {
wp_dequeue_style( 'font-awesome' );
} );
@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 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 gist:20dd9eda1e99c2d89b3e40840280008b
add_action( 'tribe_events_pro_widget_render', 'tribe_events_pro_widget_render_func', 10, 3 );
function tribe_events_pro_widget_render_func( $class, $args, $instance ) {
if ( false !== strpos( $args['widget_id'], 'fl_builder_widget' ) ) {
Tribe__Events__Pro__Mini_Calendar::instance()->register_assets();
}
}
You can’t perform that action at this time.