[select* estados "AC" "AL" "AP" "AM" "BA" "CE" "DF" "ES" "GO" "MA" "MT" "MS" "MG" "PA" "PB" "PR" "PE" "PI" "RJ" "RN" "RS" "RO" "RR" "SC" "SP" "SE" "TO"]
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 | |
if ( is_admin() && !empty( $_POST['post_ID'] ) ) { | |
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ; | |
$template_file = get_post_meta( $post_id,'_wp_page_template',TRUE ); | |
if ( $template_file == 'page_custom_template.php' ) { | |
add_action( 'init', 'custom_metabox', 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
/** | |
* 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
<?php | |
/** | |
* Mude 'wp_head' para o hook que deseja debugar | |
*/ | |
global $wp_filter; | |
echo '<pre>'; | |
var_dump( $wp_filter['wp_head'] ); | |
echo '</pre>'; |
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 mobile_home_redirect(){ | |
if( wp_is_mobile() && is_front_page() ){ | |
include( get_stylesheet_directory() . '/index-mobile.php' ); | |
exit; | |
} | |
} |
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 <[email protected]> | |
*/ | |
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 ) { |