Skip to content

Instantly share code, notes, and snippets.

View bappi-d-great's full-sized avatar

Bappi D great bappi-d-great

View GitHub Profile
@bappi-d-great
bappi-d-great / Search by category add on for WPMU Events+.php
Last active August 29, 2015 14:12
Search by category add on for WPMU Events+
<?php
/*
Plugin Name: Search by Category
Description: Add a search form where users can search by category
Plugin URI: http://premium.wpmudev.org/project/events-and-booking
Version: 1.0
AddonType: Events
Author: WPMU DEV
*/
@bappi-d-great
bappi-d-great / code.php
Created January 8, 2015 20:01
Replace URL in WordPress
<?php
add_action( 'admin_menu', 'atr_menu' );
function atr_menu() {
add_options_page( 'ATR Plugin Options', 'ATR Convert', 'manage_options', 'atr-convert', 'atr_options' );
}
function atr_options() {
@bappi-d-great
bappi-d-great / code.php
Last active August 29, 2015 14:13
Custom Pagination for WPMU Marketpress
<?php
add_filter( 'mp_products_nav', 'mp_products_nav_cb', 99, 2 );
function mp_products_nav_cb( $html, $custom_query ){
global $wp_query, $mp;
$args = $mp->parse_args(func_get_args(), $mp->defaults['list_products']);
$args['nopaging'] = false;
@bappi-d-great
bappi-d-great / code.php
Last active August 29, 2015 14:13
Show subsite admin info in front end
<?php
/*
* Use [show_subsite_admin]
*/
function show_subsite_admin_func( $atts ) {
$a = shortcode_atts( array(
'exclude' => ''
), $atts );
@bappi-d-great
bappi-d-great / Provide MarketPress coupon based on Membership level.php
Last active August 29, 2015 14:13
Provide MarketPress coupon based on Membership level
add_filter( 'mp_coupon_value', 'mp_coupon_value_cb', 10, 3 );
function mp_coupon_value_cb( $return, $code, $total ) {
$arr = array(
'XXX' => 1,
'YYY' => 2
);
if( current_user_on_level( $arr[$code] ) ){
return $return;
@bappi-d-great
bappi-d-great / code.php
Created January 22, 2015 15:56
Add custom post type quota for different Pro Sites level
<?php
/*
*
* You just need to configure the $limits array. The elements are level ID - 1. So, if your level ID 1, the index will be 0.
* Then for product index add the limit
*
*/
$limits = array(
'0' => array(
@bappi-d-great
bappi-d-great / code.php
Last active August 29, 2015 14:14
Get a quote form for WPMU marketpress plugin
<?php
/*
Plugin Name: MarketPress Get a Quote
Plugin URI: http://bappi-d-great.com
Description: Embed a form in single product page
Version: 1.1
Author: Ashok (WPMU DEV)
Author URI: http://bappi-d-great.com
Copyright 2009-2013 Incsub (http://incsub.com)
@bappi-d-great
bappi-d-great / code.php
Created February 4, 2015 05:34
Show Pro Sites list with level
<?php
// Shortcode [show_pro_sites]
function show_pro_sites_func( $atts ) {
global $psts;
$sites = wp_get_sites( array( 'limit' => 5000 ) );
$html .= '<table width="100%" cellspacing="0" cellpadding="0">';
$html .= '<tr>';
$html .= '<th>Site Name</th>';
$html .= '<th>Admin</th>';
@bappi-d-great
bappi-d-great / code.php
Created February 4, 2015 09:53
User Registration to Subscription (wpmu)
<?php
/*
Plugin Name: User Registration to Subscription (wpmu)
Plugin URI: http://bappi-d-great.com
Description: This plugin allows your users to auto subscribe when registered
Author: WPMU DEV
Version: 1.0.1
Author URI: http://bappi-d-great.com
*/
@bappi-d-great
bappi-d-great / code.php
Created February 5, 2015 21:09
WPMU Events+ category filter add on calendar view
<?php
/*
Plugin Name: Event Calendar Category Filter
Description: Filter by category in the calendar
Plugin URI: http://premium.wpmudev.org/project/events-and-booking
Version: 0.25
Author: WPMU DEV
AddonType: Events
*/