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 | |
function valida_url_preg($url) | |
{ | |
if (!preg_match('|^http(s)?://[a-z0-9-]+(\.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url)) { | |
return false; | |
} | |
} | |
function valida_url_filter_var($url) |
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 | |
function validaCPF($cpf) { | |
// Extrai somente os números | |
$cpf = preg_replace( '/[^0-9]/is', '', $cpf ); | |
// Verifica se foi informado todos os digitos corretamente | |
if (strlen($cpf) != 11) { | |
return false; |
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 | |
// NÃO inclua a tag do PHP acima! | |
// Coloque isso no arquivo functions.php do seu tema (filho, preferencialmente) | |
add_filter( 'cfw_get_billing_checkout_fields', 'remove_checkout_fields', 100 ); | |
function remove_checkout_fields( $fields ) { | |
unset( $fields['billing_company'] ); | |
unset( $fields['billing_city'] ); | |
unset( $fields['billing_postcode'] ); |
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 | |
/** | |
* Plugin Name: Elementor Form Additional Webhook | |
* Plugin URI: https://gist.github.com/csalzano/dfd754e0fe8b6ac10731fad8f257c0bf | |
* Description: Adds a second Webhook to an Elementor form | |
* Version: 1.0.1 | |
* Author: Corey Salzano | |
* Author URI: https://breakfastco.xyz/ | |
* License: GPLv2 or later | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html |
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 | |
//funcão para retornar array com listagem de bancos | |
function bancos(){ | |
$var_banco = array(); | |
$var_banco['246']='Banco ABC Brasil S.A.'; | |
$var_banco['748']='Banco Cooperativo Sicredi S.A.'; | |
$var_banco['117']='Advanced Cc Ltda'; | |
$var_banco['121']='Banco Agibank S.A.'; | |
$var_banco['172']='Albatross Ccv S.A'; |
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
//maps.googleapis.com | |
//maps.gstatic.com | |
//fonts.googleapis.com | |
//fonts.gstatic.com | |
//ajax.googleapis.com | |
//apis.google.com | |
//google-analytics.com | |
//www.google-analytics.com | |
//ssl.google-analytics.com | |
//youtube.com |
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 | |
/* | |
* Set the following constants in wp-config.php. | |
* These should be added somewhere BEFORE the constant ABSPATH is defined. | |
* | |
* Author: Chad Butler | |
* Author URI: https://butlerblog.com | |
* | |
* For more information and instructions, see: https://b.utler.co/Y3 |
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
DELETE FROM wp_usermeta | |
WHERE NOT EXISTS ( | |
SELECT * FROM wp_users | |
WHERE wp_usermeta.user_id = wp_users.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
SELECT p1.* | |
FROM prfx_faturas p1 | |
INNER JOIN | |
( | |
SELECT MAX(id) MaxID | |
FROM prfx_faturas | |
WHERE id_auxiliar = 123 | |
GROUP BY id_gateway_carne | |
) p2 | |
ON p1.id = p2.MaxID |