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 / first-name-shortcode.php
Created June 5, 2024 19:10
Get First Name (aka first word in page title)
<?php
add_shortcode( 'first_name', 'get_first_name' );
function get_first_name() {
$title = get_the_title();
$full_name_seperate = explode( ' ', $title );
return $full_name_seperate[0];
}
@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
@diggeddy
diggeddy / Add featured image to menu iems
Created July 26, 2022 13:32
Menu Item Featured Image
.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|