Skip to content

Instantly share code, notes, and snippets.

View gbissland's full-sized avatar

Gareth Bissland gbissland

View GitHub Profile
@polevaultweb
polevaultweb / acf_pro_license_constant.php
Last active March 22, 2023 03:06
Define the Advanced Custom Fields Pro license key with a constant
<?php
function my_filter_acf_pro_license_option( $pre ) {
if ( ! defined( 'ACF_PRO_LICENSE' ) || empty( ACF_PRO_LICENSE ) ) {
return $pre;
}
$data = array(
'key' => ACF_PRO_LICENSE,
'url' => home_url(),
@andrewlimaza
andrewlimaza / my-pmpro-change-seat-to-member.php
Last active July 29, 2024 09:27
Change the word "Seat(s)" to "Member(s)" for Paid Memberships Pro Sponsored Members Add On.
<?php
/**
* This will change all instances of seat(s) to member(s) for the Sponsored Members Add On - https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_seat_to_member( $output_text, $input_text, $domain ) {
if ( 'pmpro-sponsored-members' === $domain ) {
$output_text = str_replace( 'seats', 'members', $output_text );
$output_text = str_replace( 'Seats', 'Members', $output_text );
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 );
@Pross
Pross / gist:ae7f81249c5f61b33fd06c2a35284ad9
Last active December 4, 2019 19:07
2.2 from earlier versions

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

@andrewlimaza
andrewlimaza / pay-by-check-instructions.php
Last active June 25, 2020 18:48
Load Pay By Check Instructions Before Billing Address Details
<?php
/**
* Change location where the Pay By Check Instructions are displayed when the Address For Free Levels Add On is installed.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_location_for_checkout_instructions() {
remove_filter('pmpro_checkout_after_payment_information_fields', 'pmpropbc_pmpro_checkout_after_payment_information_fields' );
add_filter('pmpro_checkout_boxes', 'pmpropbc_pmpro_checkout_after_payment_information_fields', 25 );
}
<?php
/**
*-----------------------------------------------------------
* Add publisher logo/image schema for Beaver Builder plugin
*-----------------------------------------------------------
*
* Filter: 'fl_schema_meta_publisher_image_url'
* Defined in: bb-plugin/modules/post-grid/post-grid.php
*
<?php
/*
* Say you have table which table id is 101 and you want to filter some data
* Please disable caching for this table and load using ajax renderer
*/
add_filter('ninja_tables_get_public_data', function ($data, $tableId) {
if($tableId != 101) {
return $data; // Return if this is not our target table
}
@neilgee
neilgee / bb-col-click.js
Last active October 2, 2019 11:13
Beaver Builder Wrap Column in Link Tag with jQuery
(function($){
$(function() {
clickColumn();
});
/*
* Make a BeaverBuilder Column clickable.
@kellenmace
kellenmace / get-beaver-builder-modules-on-page.php
Last active October 21, 2023 04:17
Get a list of all the Beaver Builder modules on a page
<?php
/**
* Class for getting a list of Beaver Builder modules.
*/
class KM_Beaver_Builder_Module_List {
/**
* Get the list of Beaver Builder modules.
*
* @param int $post_id The post ID. Default is the current post being
@psahalot
psahalot / off-canvas-search.php
Last active November 18, 2018 22:27
add search box to off-canvas menu
// Advanced Menu - off-canvas before menu items
function wpba_demo_offcanvas_menu_before( $type, $settings, $id ) { ?>
<style>
.wpba-menu-content { margin-top: 50px; padding: 40px; padding-bottom: 10px; }
</style>
<div class="wpba-menu-content">
<div class="wpba-menu-search">
<?php echo get_search_form(); ?>
</div>
<h3>About us</h3>