Skip to content

Instantly share code, notes, and snippets.

@devAsadNur
devAsadNur / custom-bank-payment-method-settings.php
Created April 15, 2025 16:15
Custom fields to the bank payment method in Dokan
<?php
/**
* @var string $ac_name
* @var string $ac_type
* @var string $routing_number
* @var string $ac_number
* @var string $bank_name
* @var string $bank_addr
* @var string $iban
* @var string $swift
@devAsadNur
devAsadNur / Tabs.tsx
Created March 17, 2025 07:10
React tabs based on tailwind component
import { useState, Children, cloneElement } from '@wordpress/element';
const Tabs = ( { tabs, children } ) => {
const [ activeTab, setActiveTab ] = useState( tabs[ 0 ]?.id || '' );
return (
<div>
{ /* Mobile Select Dropdown */ }
<div className="grid grid-cols-1 sm:hidden">
<select
@devAsadNur
devAsadNur / custom-my-account-endpoint.php
Created June 24, 2021 14:12 — forked from claudiosanches/custom-my-account-endpoint.php
Example of custom My Account endpoint.
<?php
class My_Custom_My_Account_Endpoint {
/**
* Custom endpoint name.
*
* @var string
*/
public static $endpoint = 'my-custom-endpoint';
/* Add custom menu item and endpoint to WooCommerce My-Account page */
function my_custom_endpoints() {
add_rewrite_endpoint( 'refunds-returns', EP_ROOT | EP_PAGES );
}
add_action( 'init', 'my_custom_endpoints' );
// so you can use is_wc_endpoint_url( 'refunds-returns' )
add_filter( 'woocommerce_get_query_vars', 'my_custom_woocommerce_query_vars', 0 );
@devAsadNur
devAsadNur / endpoints.php
Created May 12, 2021 21:56 — forked from joncave/endpoints.php
WP_Rewrite endpoints demo
<?php
/*
Plugin Name: WP_Rewrite endpoints demo
Description: A plugin giving example usage of the WP_Rewrite endpoint API
Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/
Author: Jon Cave
Author URI: http://joncave.co.uk/
*/
function makeplugins_endpoints_add_endpoint() {
@devAsadNur
devAsadNur / css-and-js-scrapper.js
Last active December 8, 2021 09:52
Scrapper script for downloading CSS and JS files from any website.
// Go to your desired website. Just paste the below whole script to browser console. Hit enter & see the magic!!!
(function () {
let currentUrl;
let currentUrlBase;
let filePath;
let fileName;
let fileUrl;
let scrapperPopup;
@devAsadNur
devAsadNur / most-useful-terminal-command-list.txt
Last active December 30, 2024 04:28
A list of most used terminal command list.
=======================================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//////////////// Most Useful Terminal Command List \\\\\\\\\\\\\\\\
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
=======================================================================
01. Current Working Directory:
<!-- HTML Start -->
<div class="mssf-wrapper">
<div data-mssf="1" class="mssf-step-single active">
<h3 class="mssf-step-title">Are you age 40+ and carrying extra pounds you would like to eliminate
quickly and safely?</h3>
<div class="mssf-progress-bar">
<span class="mssf-progress-counter" style="width: 10%;"></span>
</div>
<div class="mssf-form">
<div class="mssf-radio-single">