Skip to content

Instantly share code, notes, and snippets.

@adczk
adczk / forminator-block-delete-entry-subscriber.php
Created August 2, 2024 14:34
Forminator - hide and disallow bulk delete entry actions and delete/resend buttons for subscriber roles
<?php
/**
* Plugin Name: Forminator - block entry delete action for subscribers
* Plugin URI: https://gist.github.com/adczk
* Description: Hides and disallows delte entry options for subscribers; hides other buttons in single entry footer too
* Author: adczk
*
* Author URI: https://gist.github.com/adczk
* License: GPLv2 or later
@adczk
adczk / hustle-geolocation-country-caching.php
Created May 29, 2024 11:32
Hustle - geolocation country detction caching
<?php
/**
* Plugin Name: Hustle - geolocation country detction caching
* Plugin URI: https://gist.github.com/adczk
* Description: Makes Hustle cache country detection in transient, greatly reducing number of geolocation API requests
* Author: adczk
*
* Author URI: https://gist.github.com/adczk
* License: GPLv2 or later
@adczk
adczk / hustle-defender-geoip-integration.php
Created May 29, 2024 11:30
Hustle - geolocation integration with Defender plugin
<?php
/**
* Plugin Name: Hustle - geolocation integration with Defender plugin
* Plugin URI: https://gist.github.com/adczk
* Description: Makes Hustle use Defender plugin country detection for country-based visibility rules
* Author: adczk
*
* Author URI: https://gist.github.com/adczk
* License: GPLv2 or later
<?php
/**
* Plugin Name: Forminator - image upload width/height limit
* Plugin URI: https://gist.github.com/adczk
* Description: Sets custom width/size image limit for upload fields
* Author: adczk
*
* Author URI: https://gist.github.com/adczk
* License: GPLv2 or later
*
@adczk
adczk / wp-redirect-all-guests-to-homepage.php
Created May 17, 2024 09:06
WP - redirect all guests to homepage
<?php
// redirect front-end
add_action( 'template_redirect', 'redirect_guests_home' );
function redirect_guests_home() {
if ( !is_user_logged_in() ) {
$homepage_id = get_option('page_on_front');
@adczk
adczk / hustle-gecontroller-integration.php
Created April 18, 2024 14:01
Hustle - geolocation integration with Geo Controller plugin
<?php
/**
* Plugin Name: Hustle - geolocation integration with Geo Controller plugin
* Plugin URI: https://gist.github.com/adczk
* Description: Makes Hustle use Geo Controller plugin country detection for country-based visibility rules
* Author: adczk
*
* Author URI: https://gist.github.com/adczk
* License: GPLv2 or later
@adczk
adczk / woo-hpos-filter-orders-by-payment-method.php
Created April 8, 2024 11:19
WooCommerce - filter orders by Payment Method if High Performance Order Storage option is active
<?php
/* add as MU plugin
Notes:
1. it ONLY works with Hight Performance Order Storage option enabled;
2. in line 37 there's plain $_GET used without any sanitization; that's insecure
so consider extending it to make sure no malicious data is inejected/use at your own risk
@adczk
adczk / smartcrawl-add-custom-property-to-schema-preset.php
Last active May 31, 2024 13:45
Add a custom schema property with defined values to schema built using existing preset in Types Builder
<?php
/**
* Plugin Name: SmartCraw - add custom property to preset schema
* Plugin URI: https://gist.github.com/adczk
* Description: Add a custom schema property with defined values to schema built using existing preset in Types Builder
* Author: adczk
*
* Author URI: https://gist.github.com/adczk
* License: GPLv2 or later
@adczk
adczk / forminator-use-camera-for-upload.php
Created February 22, 2024 14:45
crude solution to use device's camera with upload filed in Forminator
<?php
// based partially on https://webrtc.github.io/samples/src/content/getusermedia/gum/
/* USE
1. upload as MU plugin
2. make sure there is upload field on the form
3. upload field must be set to "single" type upload
4. and it has to have custom class "csup" added in styling
@adczk
adczk / block-user-registration-by-mail-domain.php
Created December 1, 2023 10:36
Block WordPress user account registration by e-mail domain
<?php
/**
* Plugin Name: Block WordPress user account registration by e-mail domain
* Plugin URI: https://gist.github.com/adczk
* Description: Block WordPress user account registration by e-mail domain
* Author: adczk
*
* Author URI: https://gist.github.com/adczk
* License: GPLv2 or later