Skip to content

Instantly share code, notes, and snippets.

View murshed's full-sized avatar

Fahim Murshed murshed

View GitHub Profile
@AminulBD
AminulBD / bootstrap.sh
Last active June 16, 2024 14:31
Ubuntu Server LEMP Setup script
#!/bin/bash
DEBIAN_FRONTEND="noninteractive"
# Default values for parameters
DEFAULT_PHP_VERSION=8.3
DEFAULT_NODE_VERSION=20
DEFAULT_DOMAIN="example.test"
DEFAULT_USER="example"
DEFAULT_MYSQL_PASSWORD=$(openssl rand -base64 10)
@sh-sabbir
sh-sabbir / wc_order_id_in_checkout.php
Last active July 3, 2022 03:16
WooCommerce: Get order_id for existing order in checkout page
<?php
/*
* Context:
* Sometime we may need to get the `order_id` in checkout page. When redirecting from `order-pay` you can grab it from `query_var`. But as soon as you reload the page it's lost.
*/
// You can access it from WooCommerce Session. For pending order there is a key named `order_awaiting_payment` in WooCommerce Session.
// Method 1: using `WC_Session_Handler`
$wc_session = new WC_Session_Handler();
@EmranAhmed
EmranAhmed / functions.php
Last active June 8, 2023 20:34
Hook Info. Get Action hook info. What functions are hooked to an action / filter in WordPress? How can I see all the actions attached to an "add_action" hook?
<?php
if ( ! function_exists( 'hippo_plugin_hook_info' ) ):
function hippo_plugin_hook_info( $hook_name ) {
global $wp_filter;
$docs = array();
$template = "\t - %s Priority - %s.\n\tin file %s #%s\n\n";
echo '<pre>';