This file contains 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
import { NextFetchEvent, NextRequest, NextResponse } from "next/server"; | |
import { CustomMiddleware } from "./chain"; | |
export function xCurrentDomain(middleware: CustomMiddleware) { | |
return async (req: NextRequest, ev: NextFetchEvent) => { | |
const headers = new Headers(req.headers); | |
headers.set("x-current-domain", req.nextUrl.origin); | |
const response = NextResponse.next({ | |
request: { | |
headers, |
This file contains 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 | |
add_action( 'jet-engine/register-macros', function(){ | |
class Related_Items_By_Sibling_Relation extends \Jet_Engine_Base_Macros { | |
public function macros_tag() { | |
return 'rel_get_items_by_relation'; | |
} |
This file contains 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
<wpml-config> | |
<elementor-widgets> | |
<widget name="jet-accordion"> | |
<fields-in-item items_of="toggles"> | |
<field type="Classic Accordion: Title" editor_type="LINE">item_label</field> | |
<field type="Classic Accordion: Editor Content" editor_type="VISUAL">item_editor_content</field> | |
</fields-in-item> | |
</widget> | |
<widget name="jet-hotspots"> | |
<fields-in-item items_of="hotspots"> |
This file contains 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 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
function onlyNumbersMask (event) { | |
let value = event.target.value; | |
let mask = ''; | |
mask = value.replace(/\D/g, ''); | |
event.target.value = mask; | |
} |
This file contains 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
const brlCurrencyMask = (e) => { | |
const { value } = e.target; | |
let mask = ""; | |
mask = value.replace(",", "").replace(".", "").replace(/\D/g, ""); | |
const options = { minimumFractionDigits: 2 }; | |
const result = new Intl.NumberFormat("pt-BR", options).format( | |
parseFloat(mask) / 100, | |
); | |
This file contains 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
<? | |
add_action('wp_head', 'add_head_content'); | |
function add_head_content(){ | |
global $post; | |
$post_id = 123; | |
if($post->ID === $post_id) { | |
?> |
This file contains 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 | |
add_action( 'gform_pre_render', 'form_debug' ); | |
function form_debug( $form ) { | |
foreach ( $form['fields'] as &$field ) { | |
echo '<pre>'; | |
var_dump($field); | |
echo '</pre>'; | |
} | |
return $form; | |
} |
This file contains 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 | |
add_filter('gform_validation', 'validar_cpf_e_cnpj'); | |
function validar_cpf_e_cnpj($validation_result) { | |
$form = $validation_result['form']; | |
foreach ($form['fields'] as $field) { | |
$value = rgpost("input_{$field['id']}"); | |
$isActive = isActive($field, $form); | |
if ($isActive) { |
NewerOlder