Skip to content

Instantly share code, notes, and snippets.

View kshojib's full-sized avatar

Shojib khan kshojib

View GitHub Profile
@kshojib
kshojib / regenerate-images.sh
Created October 14, 2024 07:24
Regenerate thumbnails by meta query
#!/bin/bash
# Set the admin user with the right permissions (replace with the actual username or user ID)
ADMIN_USER="shojib"
# Define the brand you want to filter by (adjust the value as needed)
BRAND="World Furniture" # You can set your brand name with spaces here
# Get all product IDs where the ACF field 'brand' equals the specified brand (handle spaces with quotes)
PRODUCT_IDS=$(wp post list --post_type=product --meta_key='brand' --meta_value="$BRAND" --format=ids --user=$ADMIN_USER)
@kshojib
kshojib / regenerate-images.sh
Last active November 5, 2024 11:52
Add this file to root directory. Make the script executable: chmod +x regenerate-images.sh Then run this command ./regenerate-images.sh
#!/bin/bash
# Set the admin user with the right permissions (replace with the actual username or user ID)
ADMIN_USER="shojib"
CATEGORY_ID=2721
PAGE=1
PER_PAGE=90
PRODUCT_IDS=""
# Loop to fetch all product IDs page by page
@kshojib
kshojib / functions.php
Last active February 1, 2023 07:13
Send email to customer when order is shipped via Boxtal Connect plugin.
<?php
use Boxtal\BoxtalConnectWoocommerce\Util\Order_Util;
use Boxtal\BoxtalConnectWoocommerce\Order\Controller;
// send email to custom with tracking number on order shipped
add_action('boxtal_connect_order_shipped', 'send_tracking_number', 10, 2);
function send_tracking_number($order_id) {
$order = wc_get_order($order_id);
$email = $order->get_billing_email();