Skip to content

Instantly share code, notes, and snippets.

View gbissland's full-sized avatar

Gareth gbissland

  • Weave Digital Studio
  • New Zealand
View GitHub Profile
@zackpyle
zackpyle / modify-bb-post-autosuggest-dropdown.php
Last active May 4, 2024 00:19
Add URL to Beaver Builder Post module auto suggest dropdown
<?php
// Modify the data returned for BB post module auto suggest queries to include post URLs
add_filter('fl_builder_auto_suggest_posts_lookup', function ( $data ) {
foreach ( $data as $key => $post ) {
$post_object = get_post( $post['value'] );
// If the post object exists, append the URL path to the title
if ( $post_object ) {
$permalink = get_permalink( $post['value'] );
@pstoute
pstoute / wpumbrella-http-context.conf
Created November 17, 2023 21:01
This is the http context file that you need to add to whitelist the IP addresses for WP-Umbrella
geo $wpumbrella_ips {
default 0;
2001:41d0:306:1702::/64 1;
141.95.192.2 1;
}
@pstoute
pstoute / fortress-uabb-gf-override.php
Created June 28, 2023 20:01
This must use plugin gets added to the /wp-content/mu-plugins directory and requires no configuration to allow the fortress 2fa pages to display all by setting the gravity forms force hooks js output to false on pages including /snicco-fortress
<?php
/**
* Plugin Name: GridPane Fortress - UABB Gravity Forms Styler Override
* Description: This must use plugin overrides the Ultimate Addons forced filter to return false on fortress related pages.
* Version: 1.0
* Author: Stoute Web Solutions
* Author URI: https://stoutewebsolutions.com/
* Plugin URI: https://community.gridpane.com/t/ultimate-addons-for-beaver-builder-breaks-fortress-2fa-page-third-party/3333/80
*/
@zackpyle
zackpyle / default-image-acf.php
Last active May 18, 2023 13:37
Add default image setting to ACF image fields #acf
<?php //ignore this line - for formatting only
// add default image setting to acf image field
add_action('acf/render_field_settings/type=image', 'add_default_value_to_image_field');
function add_default_value_to_image_field($field) {
acf_render_field_setting( $field, array(
'label' => 'Default Image',
'instructions' => 'Appears when creating a new post',
'type' => 'image',
'name' => 'default_value',
@AchalJ
AchalJ / code.php
Last active October 8, 2022 01:28
PP Taxonomy Term - Custom Shortcode to get term image URL
<?php // ignore this
// Copy the code below to your current theme's functions.php file.
// Uses: [get_term_image_url] or [get_term_image_url term_id="PROVIDE TERM ID HERE"]
add_shortcode( 'get_term_image_url', function( $atts ) {
$term_id = 0;
if ( isset( $atts['term_id'] ) && ! empty( $atts['term_id'] ) ) {
$term_id = $atts['term_id'];
} else {
@zackpyle
zackpyle / *Best PowerPack Module Customization Snippets*
Last active May 18, 2023 15:26
Best PowerPack Module Customization Snippets #powerpack #beaverbuilder
Collection of PowerPack module customizations I've gathered over the years
.fl-builder-content .fill .fl-button-wrap a.fl-button,
.fl-builder-content .fill-outline .fl-button-group-button:nth-child(1) .fl-button-wrap a.fl-button,
.fl-builder-content .outline-fill .fl-button-group-button:nth-child(2) .fl-button-wrap a.fl-button {
font-family: var(--buttonFontFamily,var(--fontFamily));
font-size: var(--buttonFontSize);
font-weight: var(--buttonFontWeight);
font-style: var(--buttonFontStyle);
letter-spacing: var(--buttonLetterSpacing);
text-transform: var(--buttonTextTransform);
-webkit-text-decoration: var(--buttonTextDecoration);
@pstoute
pstoute / managewp-7g-context.conf
Last active March 22, 2022 01:05
7G Whitelist Rules for ManageWP IP addresses
if ($remote_addr ~* "(34.211.180.66|54.70.65.107|34.210.224.7|52.41.5.108|52.35.72.129|54.191.137.17|35.162.254.253|52.11.12.231|52.11.29.70|52.11.54.161|52.24.142.159|52.25.191.255|52.34.126.117|52.34.254.47|52.35.82.99|52.36.28.80|52.39.177.152|52.41.237.12|52.43.13.71|52.43.76.224|52.88.96.110|52.89.155.51|54.187.92.57|54.191.32.65|54.191.67.23|54.191.80.119|54.191.135.209|54.191.136.176|54.191.148.85|54.191.149.8|52.26.122.21|52.24.187.29|52.89.85.107|54.186.128.167|54.191.40.136|52.88.119.122|52.89.94.121|52.25.116.116|52.88.215.225|54.186.143.184|52.88.197.180|52.27.171.126|34.211.178.241|52.24.232.158|52.26.187.210|52.42.189.119|54.186.244.128|54.71.54.102|34.210.35.214|34.213.77.188|34.218.121.176|52.10.190.191|52.10.225.96|52.11.187.168|52.25.139.76|52.43.127.200|54.191.108.9|54.70.201.228|44.224.174.169|52.32.57.81|44.225.177.160|34.223.186.249|44.224.135.238|44.226.111.14|44.225.203.104|44.226.100.122|44.224.250.144|44.225.118.211|54.189.93.69|44.231.184.112|44.238.10.27|54.185.116.30|44.238.58.95|
@pstoute
pstoute / betteruptime-7g-context.conf
Last active July 10, 2023 18:37
7G Whitelist for Better Uptime IPs
if ($remote_addr ~* "(23.88.41.31|3.220.166.35|45.33.100.21|45.56.78.139|45.79.47.102|143.42.97.120|143.42.97.213|116.202.157.36|116.202.33.182|142.132.140.32|142.132.140.42|142.132.140.47|142.132.140.77|168.119.90.223|168.119.96.203|54.243.207.163|74.207.228.249|95.216.117.142|139.162.109.252|142.132.140.107|142.132.140.122|172.104.109.161|172.105.169.250|172.105.173.108|172.105.190.118|172.105.206.169|2a01:4f9:2b:1b6e::|2a01:4f8:10b:3d1b::|2a01:4f8:231:2ac9::|2a01:4f8:251:53df::|2a01:4f8:261:1254::|2a01:4f8:261:1257::|2a01:4f8:261:1262::|2a01:4f8:261:1280::|2a01:4f8:261:1296::|2a01:4f8:261:129f::|2a01:4f8:c17:ef62::|2a01:4f8:c010:9ef1::|2400:8902::f03c:92ff:fe47:3951|2400:8902::f03c:92ff:fe47:395f|2400:8902::f03c:92ff:fecd:665e|2400:8907::f03c:92ff:fe47:3955|2400:8907::f03c:92ff:fe47:397a|2400:8907::f03c:92ff:fe47:399e|2600:3c00::f03c:92ff:feaa:0335|2600:3c00::f03c:92ff:feaa:0354|2600:3c02::f03c:92ff:feba:b84a|2600:3c02::f03c:92ff:feba:d761|2a01:7e00::f03c:93ff:fe22:2372|2a01:7e00::f03c:93ff:fe22:23c8)") {
@Clorith
Clorith / disable-fullscreen-snippet.php
Last active February 17, 2022 00:32
Quick drop-in snippet to disable the default full-screen editing mode and welcome guide in WordPress when a user first visits the edit interface.
<?php
function wp378934573289_js_head_print() {
$screen = get_current_screen();
// Only add script in editor views.
if ( 'edit' !== $screen->parent_base ) {
return;
}
?>