Skip to content

Instantly share code, notes, and snippets.

View wpmudev-sls's full-sized avatar

WPMUDEV SLS Snippets - Unofficial wpmudev-sls

View GitHub Profile
@wpmudev-sls
wpmudev-sls / wpmudev-global-events.php
Created October 3, 2017 17:04
Recent Global Events shortcode. Requires "Post Indexer" and Events+ plugins. Provides shortcode: `[global_recent_events]` allong with several atts
<?php
/**
* Plugin Name: Recent Global Events
* Plugin URI: http://premium.wpmudev.org
* Description: Recent Global Evens function and shortcode. Requires "Post Indexer" and Events+ plugins. Provides shortcode: `[global_recent_events]` allong with several atts
* Author: Panos Lyrakis @ WPMUDEV
* Author URI: http://premium.wpmudev.org
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
@wpmudev-sls
wpmudev-sls / ms_custom_registration_fields.php
Last active September 2, 2021 22:41
[Membership 2] - Custom registration fields
<?php
/**
* Plugin Name: [Membership 2] - Custom registration fields
* Plugin URI: https://premium.wpmudev.org/
* Description: Add custome fileds in Membership registration form
* Author: Panos Lyrakis @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
@wpmudev-sls
wpmudev-sls / wpmudev-front-post-title.php
Last active October 5, 2017 14:19
[WordPress General] - Modify specific post titles
<?php
/**
* Plugin Name: [WordPress General] - Modify specific post titles
* Plugin URI: https://premium.wpmudev.org/
* Description: Modify specific posts title. Title gets also changed in site meta tags.
* Author: Panos Lyrakis @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
@wpmudev-sls
wpmudev-sls / mp-admin-list-table.php
Created October 6, 2017 09:15
[MarketPress] - Admin Products List. Adds a select option "No category" in admin products table. This should display all products that have no product category set.
<?php
/**
* Plugin Name: [MarketPress] - Admin Products List
* Plugin URI: https://premium.wpmudev.org/
* Description: Adds a select option "No category" in admin products table. This should display all products that have no product category set.
* Author: Panos Lyrakis @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
@wpmudev-sls
wpmudev-sls / ps-sites-custom-options.php
Last active February 2, 2018 11:35
[Pro Sites] - Custom options in the sites/blogs list table in order to help with PayPal express gateway renewals testing
<?php
/**
* Plugin Name: [Pro Sites] - Additional options on Sites Table
* Plugin URI: https://premium.wpmudev.org/
* Description: Adds more options on the Sites table
* Author: Panos Lyrakis @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
@wpmudev-sls
wpmudev-sls / ms-assign-memberships.php
Created October 18, 2017 14:53
Cron job to add wordpress users to specific Membership 2 Pro memberships/subscriptions
<?php
/*
Plugin Name: MS2 Assign Memberships
Plugin URI: https://premium.wpmudev.org/project/membership/
Description: Gets a list of wordpress users and assign them to a membership or list of memberships
Author: Mahlamusa @ WPMU DEV
Version: 1.0.0
Author URI: https://premium.wpmudev.org/profile/mahlamusa
*/
if ( ! defined( 'ABSPATH' ) ) {
@wpmudev-sls
wpmudev-sls / custom-post-types-quotas.php
Created October 18, 2017 15:06
Post Quota for unrecognized custom post types. Some old themes register post types that Pro Sites cannot recognize, this can be used to limit those post types in Pro Sites Posts/Page Quota
<?php
/*
Plugin Name: Post Type Quota
Plugin URI: https://premium.wpmudev.org/
Description: Post type publishing quotas for Pro Sites
Author: Ashok & Lindeni @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@wpmudev-sls
wpmudev-sls / incsub-support-custom-redirect.php
Created October 19, 2017 16:35
[Incsub Support] - Redirects to custom thank you page after new ticket submit.
<?php
/**
* Plugin Name: [Incsub Support] - Custom redirect
* Plugin URI: https://premium.wpmudev.org/
* Description: Redirects to custom thank you page after ticket submit.
* Author: Panos Lyrakis @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
@wpmudev-sls
wpmudev-sls / wpmu_coursepress_get_certificate_by_date.php
Created October 29, 2017 08:42
This MU plugin allows find certificate by date using format Y-m-d
<?php
function wpmu_coursepress_get_certificate_by_date( $obj ) {
if ( !empty( $_GET['action'] ) && 'coursepress_assessments' === $_GET['action'] ) {
if ( !empty( $obj->query_vars['search_columns'] ) && array( 'user_login', 'user_nicename', 'user_email' ) === $obj->query_vars['search_columns']
&& ( $date = strtotime( str_replace( '*', '', $obj->query_vars['search'] ) ) ) ) {
preg_match( '/\d+$/', $obj->query_vars['meta_key'], $matches );
$id_course = !empty( $matches[0] ) ? (int)$matches[0] : '';
if ( $id_course ) {
global $wpdb;
$date = date( 'Y-m-d', $date );
@wpmudev-sls
wpmudev-sls / wpmu_marketpress_remove_fields_checkout.php
Created October 29, 2017 08:47
This MU plugin allows remove fields from Checkout page
<?php
function wpmu_marketpress_remove_fields_checkout( $address_fields, $type ) {
$cart = MP_Cart::get_instance();
$total = $cart->total( false );
if ( $total == 0 ) {
$allowed = array(
'billing[first_name]',
'billing[last_name]',
'billing[email]',
'billing[zip]',