Skip to content

Instantly share code, notes, and snippets.

View camaleaun's full-sized avatar

Gilberto Tavares camaleaun

  • Yogh
  • Joinville SC, Brazil
  • 04:10 (UTC -03:00)
View GitHub Profile
@camaleaun
camaleaun / single-product.php
Created November 30, 2017 02:33
Logic to make carousel for gallery thumbs with four children in each item
<?php
/**
* The Template for displaying all single products
*
* @package gallery-thumbs
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
@camaleaun
camaleaun / fb-feed-placeholder.markdown
Created August 17, 2016 02:17
FB Feed Placeholder
<div class="budget">
<p>Solicite um orçamento</p>
<form class="form-pedido" id="form-pedido-add" method="post" action="<?php echo esc_attr( site_url() ); ?>/orcamento">
<?php wp_nonce_field( 'ac_nonce_produtos', 'nonce_produtos', true, true ); ?>
<input type="hidden" name="type_page_verify" value="produtos" />
<input type="hidden" name="prod" value="<?php the_ID(); ?>"/>
<?php
$cores = get_field( 'cores' );
if ( $cores ) {
@camaleaun
camaleaun / testpost.php
Created December 11, 2017 12:51
Test post
<?php
print_r($_POST);
?>
<form method="POST" action="testpost.php">
<input type="hidden" name="prod" value="teste" />
<button class="btn-orcamento center-block" type="submit">adicionar ao orçamento</button>
</form>
@camaleaun
camaleaun / .editorconfig
Last active May 22, 2018 02:02
Recaptcha v2 php
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
root = true
[*]
charset = iso-8859
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
@camaleaun
camaleaun / functions.php
Created June 5, 2018 20:14
Function to wc myaccount navigation add
add_filter( 'woocommerce_account_menu_items', 'daico_account_menu_items2' );
function daico_account_menu_items2( $items ) {
unset( $items['customer-logout'] );
$items['orders'] = 'Vendas';
$items['customer-logout'] = 'Sair';
return $items;
}
@camaleaun
camaleaun / mysqldump.php
Last active June 27, 2018 13:10
Dump wp database by file
<?php
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
if ( file_exists( ABSPATH . 'wp-config.php') ) {
@camaleaun
camaleaun / wp-api_inspector.html
Last active July 5, 2018 17:29
Inspector to WordPress rest API with fetch and Vue.js
<!DOCTYPE html>
<html>
<head>
<title>WordPress Inspector</title>
<meta charset="utf-8">
<link rel="icon" href="https://visie.com.br/favicon.ico">
<style>
body {
margin: 0;
padding: 0;
add_action( 'init', 'short_aliases' );
add_filter( 'short_aliases', 'shorts_redirect' ) );
function short_aliases() {
$aliases = apply_filters( 'short_aliases', array() );
if ( ! is_array( $aliases ) ) {
$aliases = array();
}
foreach ( $aliases as $alias => $redirects ) {
add_rewrite_rule( "^$alias/?", $redirects, 'top' );
@camaleaun
camaleaun / chat.html
Created July 31, 2018 18:23
Hsform hack to redirects to HypnoBx chat
<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
hbspt.forms.create({
portalId: "PORTAL_ID_HERE",
formId: "FORM_ID_HERE"
});
var chatData = {};