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 / 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 functions.php
add_filter( 'fl_module_upload_regex', function( $regex, $type, $ext, $file ) {
$regex['photo'] = '#(jpe?g|png|gif|bmp|tiff?|svg)#i';
return $regex;
}, 10, 4 );
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' );
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();
}
}
View gist:bba1cff2633d5d1d3c962b9e80871b4a
add_action( 'after_setup_theme', function() {
remove_shortcode( 'fl_year' );
add_shortcode( 'fl_year', function( $atts ) {
$atts = shortcode_atts( array(
'format' => 'Y',
), $atts );
$date = date( $atts['format'] );
$tz = get_option( 'timezone_string' );
View functions.php
<?php
add_action( 'pre_get_posts', function ( $q ) {
if ( true === $q->get( 'wpse_is_home' ) ) {
$q->is_home = true;
}
});
function fl_builder_loop_query_args_filter( $query_args ) {
$query_args['ignore_sticky_posts'] = false;
$query_args['wpse_is_home'] = true;
You can’t perform that action at this time.