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
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
<script type="text/javascript" src="jquery-1.7.1.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function () { | |
$.getJSON('estados_cidades.json', function (data) { |
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
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |
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( have_rows('tabs') ): ?> | |
<ul class="nav nav-tabs" id="myTab" role="tablist"> | |
<?php $i=0; while ( have_rows('tabs') ) : the_row(); ?> | |
<?php | |
$string = sanitize_title( get_sub_field('tab_title') ); | |
?> | |
<li role="presentation" <?php if ($i==0) { ?>class="active"<?php } ?> > | |
<a href="#<?php echo $string ?>" aria-controls="<?php echo $string ?>" role="tab" data-toggle="tab"><?php the_sub_field('tab_title'); ?></a> | |
</li> | |
<?php $i++; endwhile; ?> |
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 | |
// PHP memory limit for this site | |
define( 'WP_MEMORY_LIMIT', '128M' ); | |
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
// Database | |
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
// Explicitely setting 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 | |
add_filter('pll_get_post_types', 'wearewp_add_acf_pll', 10, 2); | |
function wearewp_add_acf_pll( $post_types, $is_settings ) { | |
$post_types[] = 'acf-field-group'; | |
return $post_types; | |
} |
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
@mixin breakpoint( $start, $stop: null ) { | |
$breakpoints: ( | |
'small': 480px, | |
'medium': 720px, | |
'large': 960px, | |
'huge': 1200px, | |
'container': $container, | |
); | |
$start: validate-point( $start, $breakpoints ); |
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 | |
class YS_Mail { | |
public function YS_Mail() {} | |
public function enviar( $e ) { | |
$headers = "From: ".$e['from_name']." <".$e['to_mail']."> \n"; | |
$headers .= "Reply-To:".$e['from_name']." <".$e['from_mail']."> \n"; |
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 | |
// https://br.wordpress.org/plugins/really-simple-captcha/ | |
$captcha_instance = new ReallySimpleCaptcha(); | |
$captcha_instance->bg = array( 255, 255, 255 ); | |
$word = $captcha_instance->generate_random_word(); | |
$prefix = mt_rand(); | |
$img_captcha = $captcha_instance->generate_image( $prefix, $word ); | |
if ( isset( $_POST['send'] ) && $_POST['send'] == 'ok' ) { | |
if ( $captcha_instance->check( $_POST['prefix'], $_POST['captcha'] ) ) { |
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 | |
$menu_items = wp_get_nav_menu_items('Menu Principal'); // PEGA TODOS OS ITENS DO Menu Principal | |
$menu_mobile = array(); | |
foreach ( $menu_items as $key => $value ) { // SEPARA OS ITENS EM SUBMENUS | |
if ( !is_array( $menu_mobile[$value->menu_item_parent] ) ) { | |
$menu_mobile[$value->menu_item_parent] = array(); | |
} | |
array_push( $menu_mobile[$value->menu_item_parent], $value ); | |
} | |
?> |
OlderNewer