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
interface IHttpError { | |
name: string; | |
message: string; | |
status: number; | |
details?: unknown; | |
} | |
const HttpMethod = { | |
GET: "GET", | |
POST: "POST", |
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 | |
if (!class_exists(WP_Disable_Comments)) { | |
class WP_Disable_Comments | |
{ | |
private static $instance = null; | |
public static function get_instance() | |
{ |
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
SET @prefix = 'wp_'; -- DEFINE TABLES PREFIX | |
SET @old_url = 'http://old-site.com'; -- DEFINE THE OLD/CURRENT URL | |
SET @new_url = 'http://new-site.com'; -- DEFINE THE NEW URL | |
SET @query1 = CONCAT('UPDATE ', @prefix, 'options SET option_value = REPLACE(option_value, ''', @old_url, ''', ''', @new_url, ''') WHERE option_name = ''home'' OR option_name = ''siteurl'''); | |
PREPARE stmt1 FROM @query1; | |
EXECUTE stmt1; | |
DEALLOCATE PREPARE stmt1; | |
SET @query2 = CONCAT('UPDATE ', @prefix, 'posts SET post_content = REPLACE(post_content, ''', @old_url, ''', ''', @new_url, ''')'); |
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
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 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 | |
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 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
<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 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
function onlyNumbersMask (event) { | |
let value = event.target.value; | |
let mask = ''; | |
mask = value.replace(/\D/g, ''); | |
event.target.value = mask; | |
} |
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
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, | |
); | |
NewerOlder