Skip to content

Instantly share code, notes, and snippets.

@Qubadi
Qubadi / gist:d6375ff27c1044416a665af09a294e80
Created November 6, 2023 20:17
Jetformbuilder add icon to the form input field.
Dont forget to change the form field to your fields.
function enqueue_icons_script_and_styles() {
// Enqueue the Font Awesome stylesheet for the icons
wp_enqueue_style('font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css');
// Add inline styles
$custom_css = "
.input-icon {
@Qubadi
Qubadi / gist:e6da6e619fb7516fa902a27e26d68a7f
Created November 6, 2023 14:04
When a product is deleted, this code will work to remove the featured image and gallery images of a WooCommerce product from the WordPress media library
add_action('before_delete_post', function ($post_id) {
// Check if the post being deleted is a WooCommerce product
if (get_post_type($post_id) !== 'product') {
return;
}
// Delete the featured image (post thumbnail) if it exists
$thumbnail_id = get_post_thumbnail_id($post_id);
if (!empty($thumbnail_id)) {
wp_delete_attachment($thumbnail_id, true);
@Qubadi
Qubadi / gist:5cc4ff6ddb6ed13a1175dc631dc0f844
Last active March 1, 2024 16:21
Sending a verification code upon user registration. Creating a shortcode for the verification form. Handling the form submission via AJAX. Adding a custom column to the user list to show account status. Checking the verification status during the login process. Automatically logging out unverified users.
UPDATED
-----------------
Dont forget to use the shortcode:
[verify_user_account]
Change this ; https://your-domain-name.com/your-verfi-page-name-slug to yours url
Custom code :
// Hook into user registration to generate and send the verification code
add_action('user_register', 'send_verification_code', 10, 1);
@oooh-boi
oooh-boi / gist:a2e47433443125887d20aafd5cec7388
Created January 18, 2020 12:21
OoohBoi Video Tutorial : Full-height Image Widget in Elementor PRO
/* be sure to copy-paste to the Image Widget Custom CSS panel */
selector,
selector .elementor-widget-container,
selector .elementor-image,
selector .elementor-image > a {
height: 100%;
}
selector .elementor-image img {
object-fit: cover;
object-position: 50% 50%;
@mikepfeiffer
mikepfeiffer / stress.sh
Created January 27, 2019 21:05
Install Stress Utility on Amazon Linux 2
sudo amazon-linux-extras install epel -y
sudo yum install stress -y
@lopspower
lopspower / README.md
Last active May 25, 2024 05:42
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@raelgc
raelgc / Email Server (Windows Only).md
Last active May 5, 2024 16:43
Setup a Local Only Email Server (Windows Only)