This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//128 is a popup ID | |
let popupId = 'jet-popup-128', | |
data = { | |
popupId: popupId, | |
}; | |
//Open popup | |
jQuery( window ).trigger( { | |
type: 'jet-popup-open-trigger', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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.', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'; | |
*/ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder