Skip to content

Instantly share code, notes, and snippets.

@Mohsin-Shakeel
Mohsin-Shakeel / jet-engine-macros-shortcode.php
Created March 2, 2025 16:12 — forked from Crocoblock/jet-engine-macros-shortcode.php
Register [jet_engine_macros] shortcode to use JetEngine macros anywhere
<?php
/**
* How to use:
* 1. Add this code to your website with any code snippets plugin or into functions.php of your active theme.
* 2. In your admin area go to JetEngine/Macros Generator, generate and copy macros you need.
* 3. Use this macros anywhere with shortcode in following format: [jet_engine_macros macros="%generated_macros%"]
*
* Real world example:
* [jet_engine_macros macros="%jet_engine_field_name|event_date|field_value%"]
*/
@Mohsin-Shakeel
Mohsin-Shakeel / jetpopup trigger.js
Last active February 22, 2025 12:56
Open / Close Popup Manually
jQuery(document).ready(function ($) {
$(document).on("jet-form-builder/ajax/on-success", function (event, response, form) {
console.log(event, response, form);
setTimeout(function () {
$(window).trigger({
type: "jet-popup-close-trigger",
popupData: {
popupId: "jet-popup-3415",
constantly: false,
},
@Mohsin-Shakeel
Mohsin-Shakeel / Refresh gutenberg Lisitng.js
Last active February 22, 2025 12:57
Refresh Gutenberg Listing grid Widget on Button Click - Jet Engine
document.addEventListener("DOMContentLoaded", function () {
let refreshButton = document.querySelector("#refresh");
let listing = document.querySelector("#topics");
// Refresh Function
function reloadListingGrid(widget) {
const jetListingItems = widget.querySelector(".jet-listing-grid__items");
const navData = jetListingItems.dataset.nav;
try {
@Mohsin-Shakeel
Mohsin-Shakeel / listingupdate.js
Last active February 22, 2025 13:02
Update Listing grod widget on form submit - Jetengine Elementor
jQuery(document).ready(function ($) {
$(document).on("jet-form-builder/ajax/on-success", function (event, response, form) {
console.log(event, response, form);
let submitForm = form[0];
refreshListingGrids();
setTimeout(function () {
submitForm.querySelector(".jet-form-builder-messages-wrap > div").remove();
}, 500);
});