Skip to content

Instantly share code, notes, and snippets.

@MjHead
MjHead / validate-cct-item.php
Created August 15, 2022 15:53
Insert new CCT item with JetFormBuilder only if similar item not exists
<?php
/**
* 1. Add action Hook before Insert/update CCT, set 'validate-cct' as hook name - https://i.imgur.com/48wcTA4.png
* 2. Replace 'tournaments' with your actual CCT slug
* 3. Replace 'name' with actual parameters to find similar items
*/
add_filter( 'jet-form-builder/custom-filter/validate-cct', function( $result, $request, $action ) {
$cct_slug = 'tournaments';
$cct = \Jet_Engine\Modules\Custom_Content_Types\Module::instance()->manager->get_content_types( $cct_slug );
@AidasK
AidasK / HowToDeleteAllCloudflareRecors.md
Last active February 7, 2026 09:56
Cloudflare delete all DNS records. Just go to cloudflare dns zones, open your browers developer console and paste this javascript code.

image

Real developers are not used to clicking, it's allways easier to write a script to do it for you.
@MjHead
MjHead / custom-admin-column-callback.php
Created December 21, 2018 09:43
Custom callback function example
<?php
/**
* Custom callback example
*
* @param string $column Column name
* @param int $post_id Post ID
* @return string
*/
function jet_admin_column_callback_example( $column, $post_id ) {
@dvlop
dvlop / gist:fca36213ad6237891609e1e038a3bbc1
Last active February 16, 2026 04:20 — forked from allthingsdem/gist:63b3223a7d14ac1f2457
My long list of bad bots to block in htaccess, ready to copy and paste!
# Start Bad Bot Prevention
<IfModule mod_setenvif.c>
# SetEnvIfNoCase User-Agent ^$ bad_bot
SetEnvIfNoCase User-Agent "^12soso.*" bad_bot
SetEnvIfNoCase User-Agent "^192.comAgent.*" bad_bot
SetEnvIfNoCase User-Agent "^1Noonbot.*" bad_bot
SetEnvIfNoCase User-Agent "^1on1searchBot.*" bad_bot
SetEnvIfNoCase User-Agent "^3D_SEARCH.*" bad_bot
SetEnvIfNoCase User-Agent "^3DE_SEARCH2.*" bad_bot
SetEnvIfNoCase User-Agent "^3GSE.*" bad_bot