Skip to content

Instantly share code, notes, and snippets.

View hiranthi's full-sized avatar

Hiranthi Herlaar hiranthi

View GitHub Profile
@mjangda
mjangda / autosaver.js
Created March 3, 2010 05:42
How to hook into and pass your plugin data though WordPress Autosave
// Must be in an external file or loaded at the end of wp_footer()
jQuery(document).ajaxSend(function(e, x, a) {
var awesome = 1;
a.data += '&' + jQuery.param( {is_awesome: awesome} );
});
@strangerstudios
strangerstudios / gist:1633637
Last active September 29, 2015 16:57
Locking Down bbPress Forums using Paid Memberships Pro
/*
*****
UPDATE: This gist is no longer needed.
The better way to integrate PMPro and bbPress is to the use the pmpro-bbpress plugin,
which is now available in the WordPress repository:
http://wordpress.org/plugins/pmpro-bbpress/
*****
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@maxxscho
maxxscho / style.css
Created April 19, 2012 07:34
Wordpress Default CSS Styles
/* !-------- WORDPRESS CLASSES ------------------- */
/*------------------------------------------------------------ *\
\*------------------------------------------------------------ */
/* !-- WP WYSIWYG Editor Styles -- */
.entry-content img {
margin: 0 0 1.5em 0;
}
.alignleft, img.alignleft {
margin-right: 1.5em;
@deckerweb
deckerweb / gist:3498510
Created August 28, 2012 14:30
Multisite Toolbar Additions -- constants for customizing
<?php
// since plugin version v1.0:
// Constants:
/** Multisite Toolbar Additions: Disable Custom Nav Menu for Super Admins */
define( 'MSTBA_SUPER_ADMIN_NAV_MENU', FALSE );
/** Multisite Toolbar Additions: Disable Plugin Support for Network Wide Plugins */
@samikeijonen
samikeijonen / limit.php
Created March 14, 2013 06:55
Limit the number of license activations permitted based on variable prices
<?php
/*
Plugin Name: Easy Digital Downloads - Variable Pricing License Activation Limits
Plugin URL: http://easydigitaldownloads.com/extension/
Description: Limit the number of license activations permitted based on variable prices
Version: 1.0
Author: Pippin Williamson
Author URI: http://pippinsplugins.com
Contributors: mordauk
*/
@samikeijonen
samikeijonen / licence-limit.php
Created July 31, 2013 07:10
Add license limit UI for variable prices and show license key limit in [purchase_history] shortcode.
<?php
/**
* Show license key limit in [purchase_history] shortcode.
*
* @since 0.1.0
*/
function edd_site_count_downloads_license_limit_th() {
echo '<th class="edd-site-count-site-count">' . __( 'Site Count', 'edd-site-count' ) . '</th>';
@samikeijonen
samikeijonen / expire_date.php
Created August 4, 2013 08:50
Show expire date in [purchase_history] shortcode.
<?php
/* Show expire date in [purchase_history] table. */
add_action( 'edd_purchase_history_header_after', 'my_edd_stuff_downloads_expire_th', 12 );
add_action( 'edd_purchase_history_row_end', 'my_edd_stuff_downloads_expire_td', 12, 2 );
/**
* Show expire date in [purchase_history] shortcode.
*
* @since 0.1.2
*/
@clifgriffin
clifgriffin / wooslider-shopp.php
Last active December 24, 2015 10:19
Making WooSlider and Shopp play nicely together.
<?php
add_filter('wooslider_get_slides', 'shopp_wooslider', 10, 4);
public function shopp_wooslider($slides, $type, $args, $settings) {
if( is_shopp_product() ) {
$slides = array();
if ( shopp('product', 'has-images') ) {
while( shopp('product','images') ) {
$data = array( 'content' => shopp('product','get-image',"setting={$args['size']}") );
@pippinsplugins
pippinsplugins / gist:6827946
Created October 4, 2013 15:37
Show a message to users that have purchased the currently viewed product in EDD.
<?php
/**
* Show Has Purchased Item Message
*
* Prints a notice when user has already purchased the item.
*
* @since 1.0
* @global $user_ID
* @param int $download_id Download ID
* @return void