Skip to content

Instantly share code, notes, and snippets.

View allysonsouza's full-sized avatar
💻
Doing some WordPress stuff...

Allyson Souza allysonsouza

💻
Doing some WordPress stuff...
View GitHub Profile
@allysonsouza
allysonsouza / haste-project-state.bat
Created August 25, 2017 23:39
Haste Project State
:: Name: Haste Project State
:: Purpose: move projects to different folders.
:: Author: @allysonsouza
:: URL: https://github.com/allysonsouza
:: Version: 0.0.1
:: License: GPL-v2
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
@allysonsouza
allysonsouza / registration.php
Created February 13, 2017 17:25
Example of custom registration add to cart template, displaying registrations details in a table.
<?php
/**
* Registration product add to cart
* Put this file in your theme under woocommerce/single-produt/add-to-cart
*
* @author Allyson Souza
* @package Registrations for WooCommerce/Templates
* @version 1.0.0
*/
@allysonsouza
allysonsouza / functions.php
Last active January 31, 2017 09:15
Add .stl mime type to WordPress
<?php
/**
* Add .stl extension mime type to WordPress Media Upload
*/
function custom_mimes( $mime_types ) {
//$mime_types['stl'] = 'application/vnd.epson.salt';
$mime_types['stl'] = 'application/wavefront-stl';
return $mime_types;
}
add_filter( 'mime_types', 'custom_mimes' );
@allysonsouza
allysonsouza / functions.php
Created August 2, 2016 20:50
Enable shortcodes in WordPress default text widgets.
// Enable shortcodes in text widgets
add_filter( 'widget_text', 'do_shortcode' );
@allysonsouza
allysonsouza / .htaccess
Created May 24, 2016 13:27
Enabling PHP 7 on Hostgator trough htaccess
# Habilitar o PHP 7.0
AddHandler application/x-httpd-php70 .php
<IfModule mod_suphp.c>
suPHP_ConfigPath /opt/php70/lib
</IfModule>
@allysonsouza
allysonsouza / exemplo_setInterval.js
Created May 1, 2016 17:13
Exemplo de aplicação da função setInterval e criação de imagem a partir do protótipo Image()
var canvas,
contexto,
imagem,
imagem_x = 0,
imagem_y = 0;
canvas = document.getElementById( "game" );
contexto = canvas.getContext( "2d" );
imagem = new Image();
imagem.src = 'images/back.png';
@allysonsouza
allysonsouza / wp-include-landing.php
Last active November 17, 2015 15:38
WordPress Redirect
<?php
if (!current_user_can('read_private_posts') && current_time('YmdHi') < 201511171800) {
include (str_replace('index.php', '', $_SERVER['SCRIPT_FILENAME']).'landing/index.php');
die;
}
?>
@allysonsouza
allysonsouza / index.html
Last active April 1, 2016 18:07
Basic HTML5 structure with <canvas> and <script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> My Page Title </title>
</head>
<body>
<canvas id="game" width="800" height="600"></canvas>
<script type="text/javascript" src="assets/js/my_script.js">
@allysonsouza
allysonsouza / index.html
Last active April 1, 2016 18:03
Basic HTML5 structure
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> Título </title>
</head>
<body>
<script type="text/javascript" src="assets/js/meu_script.js">
</script>
</body>
@allysonsouza
allysonsouza / wordpress-hook-debug.php
Last active December 1, 2020 21:16
See functions hooked to a specific WordPress hook
<?php
$hook_name = 'your-hook-name';
global $wp_filter;
error_log( print_r( $wp_filter[$hook_name] , true ) );
?>