Skip to content

Instantly share code, notes, and snippets.

View moxet's full-sized avatar

Abdul Muqsit moxet

View GitHub Profile
@moxet
moxet / email.html
Last active April 11, 2025 14:47
Transactional Email Template for JetFormBuilder, copy the code below and paste it in Jet Form Builder Email action content section, make sure to enable html as content type instead of text.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body style="background-color: #2a2a2a;
font-family: arial;
-webkit-font-smoothing: antialiased;
font-size: 16px;
@moxet
moxet / read_receipt.js
Created August 25, 2023 12:59
Jquery Code to Read Notification
<script>
jQuery(document).ready(function($) {
$(document).on('click',".fa-check-circle",function () {
var cct_id = $(this).siblings('.jet-listing-dynamic-field__content').text();
jQuery.ajax({
type: "post",
dataType: "json",
@moxet
moxet / notify.php
Last active June 22, 2024 21:22
Send Notification via JetForm Builder / JetEngine
add_action( 'jet-form-builder/custom-action/send_notification', function( $request, $action_handler ) {
$cct_id = $request['inserted_cct_notifications'];
$email_notify = $request['email_notify'];
$notification_details = $request['notification_details'];
$users = get_users();
foreach ($users as $user) {
$user_id = $user->ID;
@moxet
moxet / gist:32e34740bec6c87e8ce35ac70202e660
Last active August 17, 2023 06:28
Return Flat Terms with Levels from Shortcode [jet_post_terms tax="your-taxonomy" lvl="2"]
add_shortcode( 'jet_post_terms', function( $atts = array() ) {
$atts = shortcode_atts( array(
'tax' => '',
'lvl' => ''
), $atts, 'jet_post_terms' );
$post_id = get_the_ID();
if ( empty( $atts['tax'] ) ) {
return;
@moxet
moxet / hidden_activation_code.php
Created July 1, 2023 15:51
Create Hidden Code & Send via Email
<script>
jQuery(document).ready(function($) {
var generatePassword = (
length = 20,
wishlist = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!@-#$'
) =>
Array.from(crypto.getRandomValues(new Uint32Array(length)))
.map((x) => wishlist[x % wishlist.length])
.join('')
@moxet
moxet / reading_time.php
Created June 21, 2023 05:52
Calculate Reading Time & Store in Meta Field
function calculate_reading_time() {
if (is_single()) {
global $post;
// Adjust the words-per-minute rate according to your preference
$words_per_minute = 200;
// Get the post content
$content = get_post_field('post_content', $post->ID);
@moxet
moxet / activate.php
Created June 17, 2023 06:31
Activate User with Hook using JFB
add_action( 'jet-form-builder/custom-action/activate_user', function( $request, $action_handler ) {
//Getting code value from JFB
$code = $request['code'];
//Check all users who has the Unique code from URL
$users = get_users(array('meta_key' => 'code', 'meta_value' => $code));
if(count($users)==1)
{
$user_id = $users[0]->ID;
@moxet
moxet / terms-front-end.php
Last active June 22, 2024 21:22
JFB Hook to add terms from front-end
add_action( 'jet-form-builder/custom-action/create_terms', function( $request, $action_handler ) {
$terms = explode(',', $request['terms']);
$taxonomy = $request['tax']; // Replace with your actual taxonomy name
foreach ($terms as $term) {
// Check if the term already exists
$existing_term = term_exists($term, $taxonomy);
@moxet
moxet / random_password.js
Created May 3, 2023 04:02
Random Password Generator for Wordpress Jquery JFB
<script>
jQuery(document).ready(function($) {
var generatePassword = (
length = 20,
wishlist = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~!@-#$'
) =>
Array.from(crypto.getRandomValues(new Uint32Array(length)))
.map((x) => wishlist[x % wishlist.length])
.join('')
<?php
/**
* Plugin Name: Auto Pricing
* Plugin URI: https://www.softemblems.com
* Description: Display auto convert currency for woocommerce products based on user location.
* Version: 0.1
* Text Domain: auto-pricing
* Author: Moxet Khan
* Author URI: https://www.moxetkhan.com
*/