Skip to content

Instantly share code, notes, and snippets.

# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@planetahuevo
planetahuevo / auto_enroll.php
Created February 22, 2016 02:20 — forked from supercleanse/auto_enroll.php
Automatically create a lifetime transaction for a specific product each time a user registers.
<?php
if(is_plugin_active('memberpress/memberpress.php')) {
add_action( 'user_register', 'mp_auto_enroll' );
//add_action( 'gform_user_registered', 'mp_auto_enroll', 10, 4 );
function mp_auto_enroll($user_id, $user_config=array(), $entry='', $user_pass='') {
$txn = new MeprTransaction();
$txn->user_id = $user_id;
<?php
/*
// recipients array example
$recipients = array(
array('address'=>
array(
'email' => 'email@tld.com',
'name'=>'Carlos Cabral'
)
@planetahuevo
planetahuevo / gtm-intercom.js
Created October 26, 2016 22:55 — forked from beastawakens/gtm-intercom.js
Adding Google Tag Manager variables to intercomSettings
<script>
// app ID
var intercomSettings = {
app_id: "{{IC - Dynamic app ID}}"
};
// Verifies and cleans all GTM variables
function pushGTMVariablesToIntercom(gtmKey, gtmValue) {
if("{{User - Account - Type}}" != "Guest"){
if(gtmValue != null && gtmValue != "" && gtmValue != "undefined") {
<script>
var intercomSettings = {
app_id: "{{Intercom app ID}}"
};
(function() {var w = window;var ic = w.Intercom;if (typeof ic === "function") {ic('reattach_activator');ic('update', intercomSettings);} else {var d = document;var i = function() {i.c(arguments)};i.q = [];i.c = function(args) {i.q.push(args)};w.Intercom = i;var s = d.createElement('script');s.type = 'text/javascript';s.async = true;
s.src = 'https://widget.intercom.io/widget/{{Intercom app ID}}';
var x = d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);}})();
</script>
@planetahuevo
planetahuevo / hello-bar-single.php
Created September 18, 2017 22:25 — forked from neilgee/hello-bar-single.php
Genesis HelloBar Preheader Full Width
<?
//Don't paste in the above php tag
// Enqueue scripts and styles
add_action( 'wp_enqueue_scripts', 'hello_bar_scripts_styles' );
function hello_bar_scripts_styles() {
wp_enqueue_script( 'hello-bar', esc_url( get_stylesheet_directory_uri() ) . '/js/hello-bar.js', array( 'jquery' ), '1.0.0' );
}
@planetahuevo
planetahuevo / email-con-preguntas-para-presupuesto-web.txt
Created November 16, 2017 17:37 — forked from maugelves/email-con-preguntas-para-presupuesto-web.txt
Correo electrónico con preguntas básicas para la elaboración del presupuesto de un proyecto web.
Hola <nombre del cliente>:
Ante todo muchas gracias por ponerte en contacto y por confiar en nuestros servicios para el desarrollo de tu web.
Necesitaría que por favor respondas las siguientes preguntas para realizar un presupuesto acorde a las necesidades de tu proyecto.
====================
Sobre su negocio:
- ¿A qué se dedica tu empresa/proyecto/emprendimiento?
@planetahuevo
planetahuevo / Contract Killer 3.md
Created November 16, 2017 23:18 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@planetahuevo
planetahuevo / functions.php
Created November 27, 2017 14:00 — forked from fernandiez/functions.php
Create menu section under Tools in WordPress admin dashboard and Editor role redirect
<?php
// Create menu section under Tools in WordPress admin
add_action( 'admin_menu', 'docs_admin_menu' );
// New section under Tools
function docs_admin_menu() {
add_management_page( 'Docs', 'Docs', 'manage_categories', 'docs', 'content_docs_admin_menu' );
}
@planetahuevo
planetahuevo / wp_mail.md
Created May 17, 2018 18:49 — forked from johnbillion/wp_mail.md
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This is accurate as of WordPress 4.9.

There are a few TODOs left. Please bear with me.