Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Portfolio Archive
*
*/
/**
* Display as Columns
*
*/
@nickdavis
nickdavis / column-opening-div-class-examples.html
Created April 23, 2014 14:40
HTML Columns Opening Div Class examples for LeanThemes.co
<!-- For the first column you must include 'first' -->
<div class="pricing-column one-half first">
<div class="pricing-column one-third first">
<div class="pricing-column one-fourth first">
<!-- For later columns do not include 'first' -->
<div class="pricing-column one-half">
<div class="pricing-column one-third">
<div class="pricing-column one-fourth">
@unusorin
unusorin / MultiCurl.class.php
Created September 19, 2012 13:03 — forked from okitry/MultiCurl.class.php
MultiCurl class PHP
<?php
/**
* MultiCurl class library is a PHP solution for work with MULTI CURL extension.
* It provides to execute some parallel HTTP requests with limit of downloaded
* size. Example: start 100 downloads with 2 parallel sessions, and get only
* first 100 Kb per session.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@edwardsfriedman
edwardsfriedman / gist:17a66e22e5f5b81bf4e4470e9ce26f29
Created August 16, 2016 15:33
Heap super property implementation
<%# Enables heap super properties so heap will send properties even when called before it has loaded. %>
window.heap = window.heap || []; for (var n = ["clearEventProperties", "removeEventProperty", "addEventProperties", "setEventProperties", "unsetEventProperty", "addUserProperties", "identify", "track"], o = function(e) { return function() { window.heap.push([e].concat(Array.prototype.slice.call(arguments, 0))) }}, t = 0; t < n.length; t++) { var r = n[t]; window.heap[r] = o(r)};
var locale = "<%= I18n.locale %>"
<%# Set locale as heap super property. %>
window.heap.addUserProperties({ locale: locale });
analytics.load("<%= segment_key %>");
@BFTrick
BFTrick / heap.php
Last active November 4, 2016 14:59
Load Heap Analytics
<?php
/*
* Plugin Name: Heap Analytics
* Plugin URI: https://gist.github.com/BFTrick/bb3b3b0e0497e8adecfa00e3c8e1b33d
* Description: Send all site data to Heap Analytics
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com
* Version: 1.0
*/
<?php
/*
// recipients array example
$recipients = array(
array('address'=>
array(
'email' => 'email@tld.com',
'name'=>'Carlos Cabral'
)
@cartpauj
cartpauj / mepr-autoembed-thankyou-page-messages.php
Created June 7, 2016 16:09
WP Autoembed MemberPress thank you page messages
<?php
/* Enter Your Custom Functions Here */
function mepr_autoembed_thankyou_message($message) {
global $wp_embed;
if(!class_exists('MeprTransaction')) { return $message; }
if(!isset($_REQUEST['trans_num'])) { return $message; }
$txn = new MeprTransaction();
@supercleanse
supercleanse / mp_custom_account_nav.php
Created January 28, 2014 03:30
Add custom tabs to the MemberPress Account Page
<?php
add_action('mepr_account_nav', 'custom_account_nav', 10, 1);
function custom_account_nav($user) {
$mepr_options = MeprOptions::fetch();
$whaa_url = $mepr_options->account_page_url('action=whaa');
?>
<span class="mepr-nav-item custom-whaa">
<a href="<?php echo $whaa_url; ?>" id="mepr-account-whaa"><?php _e('Whaa', 'memberpress'); ?></a>
</span>
@renventura
renventura / block-admin-login-memberpress-login-form.php
Last active February 28, 2017 22:24
Prevent Administrative Admin Login from the MemberPress Login Form
<?php //* mind this opening php tag
/**
* Snippet provided by MemberPress support and modified by Ren Ventura
**/
//* Kick admins out from MemberPress login form
add_filter( 'mepr-validate-login', 'kick_out_admins' );
function kick_out_admins( $errors ) {
@supercleanse
supercleanse / product_access_urls.php
Created October 10, 2013 20:15
List MemberPress product access urls in a page template.
<?php
if(MeprUtils::is_user_logged_in())
{
$user = MeprUtils::get_currentuserinfo();
$products = $user->active_product_subscriptions('products');
foreach($products as $product) {
if( !empty( $product->access_url ) ) {
?>
<a href="<?php echo $product->access_url; ?>"><?php echo $product->post_title; ?></a><br/>