This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add BB colour presets into tinymce presets. | |
* @since Forever | |
*/ | |
add_filter( 'tiny_mce_before_init', function( $init ) { | |
$default_colours = '"000000", "Black","993300", "Burnt orange","333300", "Dark olive","003300", "Dark green","003366", "Dark azure","000080", "Navy Blue","333399", "Indigo","333333", "Very dark gray","800000", "Maroon","FF6600", "Orange","808000", "Olive","008000", "Green","008080", "Teal","0000FF", "Blue","666699", "Grayish blue","808080", "Gray","FF0000", "Red","FF9900", "Amber","99CC00", "Yellow green","339966", "Sea green","33CCCC", "Turquoise","3366FF", "Royal blue","800080", "Purple","999999", "Medium gray","FF00FF", "Magenta","FFCC00", "Gold","FFFF00", "Yellow","00FF00", "Lime","00FFFF", "Aqua","00CCFF", "Sky blue","993366", "Red violet","FFFFFF", "White","FF99CC", "Pink","FFCC99", "Peach","FFFF99", "Light yellow","CCFFCC", "Pale green","CCFFFF", "Pale cyan","99CCFF", "Light sky blue","CC99FF", "Plum"'; | |
$colours = FLBuilderModel::get_color_presets(); | |
$custom_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Beaver Builder Global JS Reset | |
Description: Resets global JS and self deactivates. | |
Author: <Simon> | |
Version: 1.0 | |
*/ | |
class BB_Global_JS_Reset { | |
function __construct() { | |
include_once ABSPATH . '/wp-admin/includes/plugin.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_enqueue_scripts', function() { | |
if ( ! isset( $_GET['fl_builder'] ) ) { | |
wp_dequeue_style( 'font-awesome' ); | |
wp_dequeue_style( 'font-awesome-5' ); | |
wp_deregister_style( 'font-awesome' ); | |
wp_deregister_style( 'font-awesome-5' ); | |
} | |
}, 99999 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Pi-Star Nice Select | |
// @description Add search to dropdowns | |
// @version 0.1 | |
// @author Simon | |
// @match http://pi-star.local/admin/* | |
// @grant GM_getResourceText | |
// @grant GM_addStyle | |
// @require https://bluzky.github.io/nice-select2/dist/js/nice-select2.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.slim.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$(document).ready(function(){ | |
// remember to replace node id | |
let video = $( '.fl-module-video.fl-node-7nwclb8z526j .fl-video-poster' ); | |
video.attr('data-mfp-src', video.data('mfp-src') + '/?rel=0&' ); | |
}); | |
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Beaver Builder Excerpt Fix | |
Description: Removes hidden data from excerpts | |
Author: <Simon> | |
Version: 1.0 | |
*/ | |
class BB_Excerpt_Data_Fix { | |
function __construct() { | |
$post_types = FLBuilderModel::get_post_types(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fl_builder_loop_query_args_filter( $query_args ) { | |
if ( 'example-module' == $query_args['settings']->id ) { | |
$query_args['ignore_sticky_posts'] = false; | |
} | |
return $query_args; | |
} | |
add_filter( 'fl_builder_loop_query_args', 'fl_builder_loop_query_args_filter' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // added this to make the styling work | |
class FLBuilderSettingsCompatRowVideo extends FLBuilderSettingsCompatHelper { | |
public function filter_settings( $settings ) { | |
$settings->bg_video_fallback_src = str_replace( 'https://smithcountylumber.com', 'https://smithcountylumber.b-cdn.net', $settings->bg_video_fallback_src ); | |
return $settings; | |
} | |
} | |
add_action( 'init', function() { | |
FLBuilderSettingsCompat::register_helper( 'row', 'FLBuilderSettingsCompatRowVideo' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'user_register', 'add_user_to_sendy_list' ); | |
function add_user_to_sendy_list( $user_id ) { | |
$list = 'SENDY_LIST_ID'; | |
$url = 'http://SENDY_INSTALL_URL/subscribe'; | |
$user = get_userdata( $user_id ); | |
$email = $user->data->user_email; | |
$name = $user->data->user_nicename; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // this lines just here so the formatting works, ignore it. | |
add_filter( 'fl_builder_render_css', function( $css, $nodes, $global_settings, $include_global ) { | |
if ( isset( $_GET['fl_builder'] ) ) { | |
return $css; | |
} | |
// keep original in case this goes tits up | |
$original = $css; | |
$parse = preg_match_all( '/(https?:\/\/.*\.(?:png|jpe?g|gif|webp))/', $css, $urls, PREG_PATTERN_ORDER ); |