Skip to content

Instantly share code, notes, and snippets.

View VictorPietro's full-sized avatar

Victor Pietro Moreno VictorPietro

View GitHub Profile
@Lonsdale201
Lonsdale201 / code
Created December 7, 2024 00:33
JetFormBuilder - Call webhook - Call Chatgpt
// place the code in the child theme functions.php or a custom code snippets plugin like Fluent Snippts etc..
// You need to add two key in your wp-config.php
// first open your wp-config.php and define( 'OPENAI_API_KEY', 'My_Chatgpt_API');
// add a new line with your auth token: define( 'CUSTOM_API_TOKEN', 'My_auth_token');
// example token define( 'CUSTOM_API_TOKEN', 'a3f9c74d2b69a7e1bcd15e2e4fc98a6c4ed12e9985bcae439f6ad5db95f17c23');
// in the Custom api token you can enter anything
// open your functions.php or fluentsnippets and paste the code which you can find below
// open your jetformbuilder add a new webhook submission and paste your wesbite domain name like
// https://mywebsite.com/wp-json/custom-webhooks/v1/chatgpt-handler?api_token=CUSTOM_API_TOKEN
@andrewjmead
andrewjmead / jetformbuilder-submit-hook.php
Last active March 22, 2025 20:31
JetFormBuilder form submission hook for WordPress
<?php
/**
* JetFormBuilder has no documentation about what hooks they fire or when they fire them.
*
* I ended up digging into their source code to try and find an action that fires for all
* form submission, even if they don't have a custom "post submit action" set up.
*
* Using jet-form-builder/form-handler/after-send gets the job done.
*/
@Crocoblock
Crocoblock / code.js
Last active March 17, 2025 14:06
JetPopup trigger open / close
//128 is a popup ID
let popupId = 'jet-popup-128',
data = {
popupId: popupId,
};
//Open popup
jQuery( window ).trigger( {
type: 'jet-popup-open-trigger',
/* By Luciano Cezareto + Crocoblock */
/* Adicione esse trecho no functions.php do tema [ou tema filho mais seguro] */
/* no campo search do smartfilters no query variable coloque:
user_prop::user_email; user_prop::user_login; user_prop::user_nicename; user_prop::ID; user_prop::user_url
--->> importante use ponto e virgula (;) para adicionar mais de um termo caso necessário. */
/*
Veja o Prints:
https://imgur.com/a/amQwmzv
https://imgur.com/a/3foNmbH
@girafffee
girafffee / jet-fb-custom-hook-api.php
Created June 24, 2021 13:56
How to set JetFormBuilder form statuses
<?php
use Jet_Form_Builder\Exceptions\Action_Exception;
add_action( 'jet-form-builder/custom-action/test_action', function ( $request, $handler ) {
if ( empty( $request['age'] ) ) {
/**
* You can use one of the default statuses
* 'success' => 'Form successfully submitted.',
* 'failed' => 'There was an error trying to submit form. Please try again later.',
@MjHead
MjHead / jet-engine-cct-api.php
Last active November 19, 2024 16:30
API to interact with JetEngine CCT from directly PHP code
<?php
/**
* JetEngine CCT-related API functions to use in theme or plugin
*
* Theme usage - include get_theme_file_path( 'jet-engine-cct-api.php' );
* Plugin usage - include PLUGIN_PATH . 'path-to-file-inside-plugin/jet-engine-cct-api.php';
*/
/**
SKU Parent Type Name Regular price Attribute 1 name Attribute 1 value(s) Attribute 1 visible Attribute 1 global
TEST001 variable Product Size S,M,L,XL,2XL 0 1
TEST001-2XL TEST001 variation 9.99 Size 2XL 1 1
TEST001-XL TEST001 variation 9.99 Size XL 1 1
TEST001-L TEST001 variation 9.99 Size L 1 1
TEST001-M TEST001 variation 9.99 Size M 1 1
TEST001-S TEST001 variation 9.99 Size S 1 1
@jezao
jezao / traduzErroPagseguro.php
Last active March 9, 2021 20:08
Pagseguro - Lista de erros traduzidos
<?php
public function translateError($code)
{
switch($code)
{
case "5003": $err = "Falha de comunicação com a instituição financeira"; break;
case "10000": $err = "Marca de cartão de crédito inválida"; break;
case "10001": $err = "Número do cartão de crédito com comprimento inválido"; break;
case "10002": $err = "Formato da data inválida"; break;
@JamoCA
JamoCA / Sanitize_Target_Blank.htm
Last active September 5, 2020 20:51
Use jQuery to automatically add noopener, noreferrer and nofollow to links w/target="_blank".
<cfcontent type="text/html; charset=UTF-8">
<!doctype html>
<html lang="en">
<head>
<title>Sanitize target="_blank"</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.slim.min.js" type="text/javascript"></script>
<script type="text/javascript">
/* 3/24/2017 Sanitize_Target_Blank.htm https://gist.github.com/JamoCA/80f65eb07f054b1326221bd4f15868d6 */
function sanitizeTargetBlank(){
$('#linkDiv a[rel~=external]').prop('target', '_blank');
@icambridge
icambridge / Dockerfile
Created February 4, 2017 12:33
Go dep in docker
FROM golang:1.7
# Set go bin which doesn't appear to be set already.
ENV GOBIN /go/bin
# build directories
RUN mkdir /app
RUN mkdir /go/src/app
ADD . /go/src/app
WORKDIR /go/src/app