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
/** | |
* Create user by Perfil is published or updated. | |
* | |
* @param int $post_id The post ID. | |
* @param post $post The post object. | |
* @param bool $update Whether this is an existing post being updated or not. | |
*/ | |
function perfil_save_create_user( $post_id, $post, $update ) { | |
$post_type = get_post_type( $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
// Cria a tabela Configuracoes se não existir | |
$conexao_configuracoes = mysqli_connect( $host, $user, $pass, $banco ) or die( "ERROR : " . mysqli_error() ); | |
$configuracoes = "configuracoes"; | |
$cria_configuracoes = $conexao_configuracoes->query("CREATE TABLE IF NOT EXISTS $configuracoes( | |
ID int NOT NULL AUTO_INCREMENT, | |
PRIMARY KEY(ID), | |
km_inicial VARCHAR(50) NOT NULL, | |
data_inicial DATE NOT NULL, | |
valor_compra VARCHAR(50) NOT NULL | |
)"); |
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
git clone https://github.com/aikiframework/json.git --recursive |
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
// JS | |
jQuery(function() { | |
jQuery('.add-request-quote-button').on('click', function() { | |
jQuery.ajax({ | |
type : 'POST', | |
url : 'wp-admin/admin-ajax.php', | |
dataType: 'json', | |
data : action_agp_qdt_itens, | |
success: function (response) { | |
jQuery('#raq_item_number').addClass('teste'); |
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
/** | |
* Redirect single result search in WP. | |
* @author Everaldo Matias <matiaseveraldo@gmail.com> | |
*/ | |
add_action( 'template_redirect', 'redirect_single_result_search' ); | |
function redirect_single_result_search() { | |
if ( is_search() ) { | |
global $wp_query; | |
if ( $wp_query->post_count == 1 ) { |
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
/** | |
* | |
* Função para retornar tag <span> com ícone da biblioteca Glyphicons | |
* | |
* @author Everaldo Matias <http://everaldomatias.github.io> | |
* @version 0.1 | |
* @since 22/02/2018 | |
* @link https://gist.github.com/everaldomatias/e3f7af6eaa19037d7046c39f6c860390 | |
* @param $icon string que irá receber a especificação do ícone | |
* @example <?php echo get_glyphicon( 'glyphicon-heart' ); ?> |
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
/** | |
* | |
* Função para criar usuário administrador no WordPress via FTP | |
* | |
* @since 17/04/2018 | |
* @see https://brasa.art.br/como-adicionar-um-usuario-no-wordpress-pelo-ftp/ | |
* @return void | |
* | |
*/ |
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
/* | |
Adiciona máscara em CPF e CNPJ no mesmo campo | |
Caso precise você pode mudar o seletor para usar um ID ou class. | |
Fonte: https://jsfiddle.net/pdd8g4mf/ | |
*/ | |
var CpfCnpjMaskBehavior = function (val) { | |
return val.replace(/\D/g, '').length <= 11 ? '000.000.000-009' : '00.000.000/0000-00'; | |
}, | |
cpfCnpjpOptions = { |
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 | |
/** | |
* Mude 'wp_head' para o hook que deseja debugar | |
*/ | |
global $wp_filter; | |
echo '<pre>'; | |
var_dump( $wp_filter['wp_head'] ); | |
echo '</pre>'; |