Skip to content

Instantly share code, notes, and snippets.

View ImonAwesome's full-sized avatar
✔️
Github Verified!

Md. Imon Hossain ImonAwesome

✔️
Github Verified!
View GitHub Profile
@ImonAwesome
ImonAwesome / copyphpfile.php
Last active May 31, 2022 19:32
Copy file from remote server and save
<?php
// Copy files from remote server.
// https://stackoverflow.com/questions/9843933/copy-file-from-remote-server-or-url
$file = 'SOURCE_URL';
$newfile = $_SERVER['DOCUMENT_ROOT'] . '/wp-content/ai1wm-backups/DIRECTORY_FIILE_NAME__WITH_EXTAINSION';
if ( copy ( $file, $newfile ) ) {
echo "Copy success!";
} else {
@ImonAwesome
ImonAwesome / endpoint-order-received-tracking-code.php
Created October 12, 2021 17:00
Add Tracking Code or Script to WooCommerce Thank You Page
<?php
/**
* @snippet Add Script @ WooCommerce Thank You Page
* @endpoint happydesk.net/checkout/order-received/ (replace with your domain)
* @testedwith WooCommerce 5
*/
add_action( 'woocommerce_thankyou', 'happydesk_conversion_tracking_thank_you_page' );
@ImonAwesome
ImonAwesome / vc-mu_loop.php
Created April 10, 2021 00:24 — forked from Jany-M/vc-mu_loop.php
[WP] Visual Composer custom query loop block / module, for WordPress Multisite
<?php
// There's also a standalone version, no Visual Composer required, purely as a shortcode here https://gist.github.com/Jany-M/d3014a7039c884a8bbd8e8271cfcd982
if( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'vcMUloop' ) ) {
class vcMUloop extends WPBakeryShortCode {
function __construct() {
add_action( 'init', array( $this, 'vc_multisite_mapping' ) );