Skip to content

Instantly share code, notes, and snippets.

View poshwaffle's full-sized avatar
Working from home

PoshWaffle poshwaffle

Working from home
View GitHub Profile
@poshwaffle
poshwaffle / js.js
Created September 11, 2020 16:48
JS
qis__rates["qis_1"] = {
"formheader": false,
"buttons": "true",
"currency": "kr",
"iso": "USD",
"ba": "after",
"separator": "none",
"primary": false,
"secondary": false,
"interesttype": "amortisation",
h2, .entry-content h2, .entry-content h2 a {
font-size: 42px;
font-size: 2.8rem;
}
[wpbb-if post:acf type='text' name='auto-make' exp='equals' value='Porsche']
This text displays when the value test is true.
[wpbb-else]
This text displays when the value test is false.
[/wpbb-if]
add_action ( 'wp_footer', function(){
if ( is_super_admin() ) return;
?>
<script id="restrict-bb-tools-menu">
jQuery(document).ready(function($){
$('.fl-builder-bar-title').css('cursor', 'inherit');
$('.fl-builder-bar-title-caret').hide();
$('body').off('click', '.fl-builder-bar-title')
});
</script>
@poshwaffle
poshwaffle / functions.php
Created August 20, 2018 17:31
Force BB language to...
add_filter( 'plugin_locale', function( $locale, $domain ) {
if ( 'fl-builder' == $domain || 'fl-builder' == $domain ) {
return 'fr_FR';
}
return $locale;
}, 10, 2 );
@poshwaffle
poshwaffle / functions.php
Last active May 10, 2021 10:06
[(2.0) Unset BB UI menu items] #BBUI
<?php // Don't copy this line, copy from line 3 onwards
add_filter( 'fl_builder_main_menu', function( $views ) {
unset( $views['main']['items'][10] ); //Save Layout
unset( $views['main']['items'][20] ); //Duplicate Layout
unset( $views['main']['items'][30] ); //Preview Layout
unset( $views['main']['items'][35] ); //Revisions
unset( $views['main']['items'][40] ); //Separator Line
unset( $views['main']['items'][50] ); //Layout CSS & Javascript
@poshwaffle
poshwaffle / js.js
Created June 13, 2018 22:14
Remove #achors tags from the browser address bar when using smooth scrolling
(function($){
$(function(){
var navBar = $('.navbar-nav'),
navLinks = navBar.find( 'a[href*="#"]:not([href="#"])' );
config = FLBuilderLayoutConfig.anchorLinkAnimations;
if ( navLinks.length > 0 ) {
navLinks.each(function(){
var link = $( this );
link.on( 'click', function(){
a:focus {
outline: none !important;
}
@poshwaffle
poshwaffle / functions.php
Created June 7, 2018 18:01
Add custom color presets and remove stored presets
function diablo_color_presets( $colors ) {
$colors = array(); // reset the array
// Red
$colors[] = 'f22740';
$colors[] = 'e31b23';
$colors[] = 'bf1724';
// Light Blue
$colors[] = 'a3c9d3';
$colors[] = '9bb6c2';
$colors[] = '7699a5';
add_filter( 'fl_builder_render_css', function( $css, $nodes, $global_settings, $include_global ) {
$site_url = 'http://bb-plugin';
$cdn_url = 'http://some-cdn';
$css = str_replace( $site_url, $cdn_url, $css );
return $css;
}, 10, 4 );