Skip to content

Instantly share code, notes, and snippets.

@mihdan
mihdan / hooks.php
Created April 13, 2023 20:25 — forked from lilumi/hooks.php
Disable WPML String Translations for Gutenberg Blocks
<?php
/*
WPML checks for gutenberg like this:
\WPML_Page_Builders_Defined->has()
```
if ( 'gutenberg' === $page_builder ) {
if ( version_compare( $wp_version, '5.0-beta1', '>=' ) ) {
return true;
}
}
@tdrayson
tdrayson / populate-dropdown.php
Created August 23, 2022 09:54
Populate ACF dropdown with Fluent forms
<?php
/*
Instructions
Replace YOUR_ACF_FIELD with the name of your acf select dropdown key
Add to functions.php or code snippets plugin
Forms will load sorted by Title in ASC order (A to Z)
@JamoCA
JamoCA / fake-image-scam-01.txt
Last active April 8, 2023 22:34
Sample of fraudulent message posted to a client's website regarding copyrighted images.
From: "Mel" Menikon897@yahoo.com
Hello,
This is Melea and I am a licensed illustrator.
I was discouraged, putting it lightly, when I came across my images at your website. If you use a copyrighted image without an owner's permission, you must know that you could be sued by the copyright holder.
It's illegal to use stolen images and it's so selfish!
@kloon
kloon / functions.php
Last active September 15, 2022 11:04
WooCommerce Dropdown Product Quantity, fully compatible with Min/Max quantities extension
<?php
// Place the following code in your theme's functions.php file
// override the quantity input with a dropdown
function woocommerce_quantity_input() {
global $product;
$defaults = array(
'input_name' => 'quantity',
'input_value' => '1',
'max_value' => apply_filters( 'woocommerce_quantity_input_max', '', $product ),
UrlEncoder = {
/**
* Encode a [deeply] nested object for use in a url
* Assumes Array.each is defined
*/
encode: function(params, prefix) {
var items = [];