Skip to content

Instantly share code, notes, and snippets.

View moxet's full-sized avatar

Abdul Muqsit moxet

View GitHub Profile
@moxet
moxet / gist:83bdabca265aad94fec4d45933ecd53a
Created December 17, 2024 08:37
Jet Form Builder to Monday.com CRM
//Use below code in your function.php or code snippet, Open your Jet Form Builder form and insert a hook in action, name your hook as monday. make sure the name of the field map in the requested variable below.
add_action('jet-form-builder/custom-action/monday', function( $request, $action_handler ) {
$name = $_REQUEST["full_name"];
$email = $_REQUEST["email"];
$contact_number = $_REQUEST["contact_number"];
$message = $_REQUEST["message"];
$token = 'API_KEY_GOES_HERE';
$apiUrl = 'https://api.monday.com/v2';
@moxet
moxet / get-related.md
Created September 10, 2024 06:08 — forked from Crocoblock/get-related.md
Get JetEngine Related Items programmatically / Update related items / Get/Update relation meta
add_action('jet-form-builder/custom-action/assign_author_cct', function( $request, $action_handler ) {
// Getting code value from JFB
$author_id = $request['customer_id'];
$cct_id = $request['inserted_cct_subscriptions'];
global $wpdb;
$table_name = $wpdb->prefix . 'jet_cct_subscriptions';
@moxet
moxet / gist:c5e270b9de422d193f5a4aff463bb1a5
Last active December 10, 2024 15:48
Jquery Code for REST API Pagination
<div id="pagin"></div>
<script>
jQuery(document).ready(function($) {
var pageSize = 12; // Number of items per page
var pageCount = Math.ceil($("#fertility .jet-listing-grid__item").length / pageSize); // Calculate total pages
for (var i = 1; i <= pageCount; i++) {
$("#pagin").append('<a href="#" class="page-link">' + i + '</a> ');
@moxet
moxet / auto-refresh.js
Created February 23, 2024 17:17
This JQuery allows you to refresh listing without page refresh, make sure to apply .mylisting class to your listing. The timeout function improve the UX by hiding success message after 3 seconds
<script>
jQuery(document).ready(function($) {
$('.jet-form-builder__submit').on('click', function() {
$('.mylistings').load(window.location.href + ' .mylistings');
setTimeout(function() {
$(".jet-form-builder-messages-wrap").fadeOut();
}, 3000);
});
});
@moxet
moxet / logout.php
Created January 25, 2024 08:28
Wordpress Logout without Confirmation
add_action('check_admin_referer', 'logout_without_confirm', 10, 2);
function logout_without_confirm($action, $result)
{
/**
* Allow logout without confirmation
*/
if ($action == "log-out" && !isset($_GET['_wpnonce'])) {
$redirect_to = isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : 'https://yoursite.com';
$location = str_replace('&amp;', '&', wp_logout_url($redirect_to));
header("Location: $location");
@moxet
moxet / google-wp-rest-api
Created December 19, 2023 12:45
Google Apps Script for Inserting Google Sheet Data to Wordpress as CPT
function Sheet_WP(e) {
var sheet = e.source.getActiveSheet();
//replace CPT with your sheet name
if(sheet.getName() == 'CPT'){
var range = e.range;
var affectedRow = range.getRow();
var postId = sheet.getRange(affectedRow, 1).getValue();
@moxet
moxet / email.html
Created September 4, 2023 10:48
Transactional Email Template for JetFormBuilder
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body style="background-color: #f6f6f6;
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;