Skip to content

Instantly share code, notes, and snippets.

@panoslyrakis
panoslyrakis / ps-limit-plugins.php
Last active July 1, 2017 21:10
Pro Sites - Limit plugins per level
<?php
/*
Plugin Name: Pro Sites - Limit plugins per level
Plugin URI: https://premium.wpmudev.org/
Description: Allow specific number of plugins to be available per level. Requires Pro Sites plugin
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@panoslyrakis
panoslyrakis / ms-edit-invoice-gateways.php
Last active June 28, 2017 08:54
Membership - Edit invoice gateways
<?php
/*
Plugin Name: Membership - Edit invoice gateways
Plugin URI: https://premium.wpmudev.org/
Description: Adds a new field for gateway option in billing info
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@panoslyrakis
panoslyrakis / mp-product-inventory-rest-api.php
Created June 22, 2017 09:37
Manage products inventory via REST API
<?php
/*
Plugin Name: MarketPress Manage inventory via REST
Plugin URI: https://premium.wpmudev.org/
Description: Manage products inventory via REST API
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
@panoslyrakis
panoslyrakis / app_latest_apps_list.php
Created June 19, 2017 17:21
Adds a shortcode that lists latest appointments
<?php
/*
Plugin Name: Appointments Latest Appointments List
Plugin URI: https://premium.wpmudev.org/
Description: Adds a shortcode that lists latest appointments
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@panoslyrakis
panoslyrakis / support-system-add-mimes.php
Created June 16, 2017 14:35
Add more mimes to support system. When nothing else works we can use map_meta_cap
add_filter( 'map_meta_cap', function( $caps, $cap, $user_id, $args ){
if( ! isset( $_FILES['support-attachment'] ) ){
return $caps;
}
$allowed_mimes = array(
'jpg' =>'image/jpg',
'jpeg' =>'image/jpeg',
'gif' => 'image/gif',
@panoslyrakis
panoslyrakis / ms-edit-currency-output.php
Created June 12, 2017 14:44
To change the currency output, eg to display currency symbol
add_filter( 'ms_model_settings__get', function( $value, $property, $obj ){
if( $property == 'currency' ){
$value = '£';
}
return $value;
}, 10 , 3 );
@panoslyrakis
panoslyrakis / app_mp_inventory.php
Created June 9, 2017 16:32
Appointments+ Update Inventory
<?php
/*
Plugin Name: Appointments+ Update Inventory
Plugin URI: https://premium.wpmudev.org/
Description: Requires Appointments+ and MarketPress. After new appointment it should update product incventory.
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@panoslyrakis
panoslyrakis / support-system-upfront-tickets-front.php
Created June 7, 2017 16:53
Adds a shortcode to display the support tickets list and single ticket in front end
<?php
/*
Plugin Name: Front end upfront support tickets
Plugin URI: https://premium.wpmudev.org/
Description: Adds a shortcode to display the support tickets list and single ticket in front end
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@panoslyrakis
panoslyrakis / app-provider-admin.php
Last active June 10, 2017 12:22
Adds an admin menu for providers to manage their appointments
<?php
/*
Plugin Name: Appointments Providers admin menu
Plugin URI: https://premium.wpmudev.org/
Description: Adds an admin menu for providers to manage and export their appointments. Allowed only to edit their appointments and set their selves as providers for new appointments.
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@panoslyrakis
panoslyrakis / cp-custom-archive-list.php
Created June 1, 2017 20:36
Custom archive virtual page for CoursePress
<?php
/*
Plugin Name: Custom archive virtual page for CoursePress
Plugin URI: https://premium.wpmudev.org/
Description: Requires CoursePress 2.0 Pro
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
if( ! class_exists( 'WPMUDEV_CP_Custom_Archive' ) ){