Skip to content

Instantly share code, notes, and snippets.

@panoslyrakis
panoslyrakis / coursepress-send-enrollment-notification-to-admin.php
Last active April 2, 2017 21:03
Send enrollment notification to admin and instructors
<?php
add_action( 'coursepress_email_sent-enrollment_confirm', function( $args, $result ){
$course_id = $args['course_id'];
$send_to = array( get_option('admin_email') );
$course_title = get_the_title( $course_id );
$course_instructors = array();
$instructors = (array) CoursePress_Data_Course::get_setting( $course_id, 'instructors', array() );
$instructors = array_filter( $instructors );
@panoslyrakis
panoslyrakis / wpmudev-ms-pass-reset-refilter.php
Created March 13, 2017 19:46
Remove default filter from 'the_content' for the password reset page and add a new one to the login hook. This way the rest content of the page will not be lost.
<?php
add_action( 'wp_head', function(){
global $wp_filter, $post;
if( ! class_exists( 'MS_Model_Pages' ) || $post->post_name != MS_Model_Pages::MS_PAGE_ACCOUNT || ! isset( $_GET['action'] ) || $_GET['action'] != 'rp' ){
return;
}
// Originally uses the_content filter in MS_Controller_Frontend::user_account_manager()
// Lets unset it so it displays the login's shortcode MS_View_Shortcode_Login::to_html()
@panoslyrakis
panoslyrakis / wpmudev-app-coupon-price-on-gcal.php
Last active July 7, 2024 08:03
Adds the coupon price of appointments in gcal description. Requires MarketPress
<?php
/**
* Plugin Name: Add coupon price of appointments in gcal
* Version: 1.2.0
* Description: Adds the coupon price of appointments in gcal description
* Author: Panos Lyrakis (WPMU DEV)
* Author URI: https://premium.wpmudev.org/profile/panoskatws
* Plugin URI: https://premium.wpmudev.org/project/appointments-plus/
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@panoslyrakis
panoslyrakis / wpmudev_cp_custom_course_lists.php
Created February 24, 2017 12:25
Custom courses list for CoursePress Pro
<?php
/**
* Plugin Name: Custom courses list for CoursePress Pro
* Version: 1.0
* Description: Provides a shortcode that outputs a custom list of courses
* Author: Panos Lyrakis (WPMU DEV)
* Author URI: http://premium.wpmudev.org
* Plugin URI: http://premium.wpmudev.org/project/coursepress/
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@panoslyrakis
panoslyrakis / wpmudev-apps-history.php
Last active February 15, 2017 18:49
Moves latest completed and removed appointments in A+ to a history table in db so the appointments table is lighter
<?php
/*
Plugin Name: Appointments+ History
Description: Moves latest completed and removed appointments to a history table in db so the appointments table is lighter
Plugin URI: https://gist.github.com/panoslyrakis/5b7f6d488f4f11701e01ac3ebf1226b9
Version: 1.0.0
Author: Panos Lyrakis ( WPMUDEV )
Author URI: https://premium.wpmudev.org/profile/panoskatws
*/
@panoslyrakis
panoslyrakis / wpmudev-ps-adsinsidebar.php
Last active January 29, 2017 19:31
Creates a shortcode and displays Pro Site ads on sidebar. Requires Pro Sites plugin
<?php
/*
Plugin Name: WPMUDEV Pro Site Ads on sidebar
Plugin URI: https://premium.wpmudev.org/
Description: Creates a shortcode and displays Pro Site ads on sidebar
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@panoslyrakis
panoslyrakis / wpmudev-mp-custom-listing.php
Created January 29, 2017 00:02
Provides a shortcode for custom product listing
<?php
/*
Plugin Name: WPMUDEV MP - Custom Products List
Plugin URI: http://premium.wpmudev.org/
Description: Provides a shortcode for custom product listing
Version: 1.0.0
Author: Panos Lyrakis (WPMUDEV)
Author URI: http://premium.wpmudev.org
License: GNU General Public License (Version 2 - GPLv2)
*/
@panoslyrakis
panoslyrakis / appointments_get_appointments_for_day.php
Created January 26, 2017 21:35
It accepts argument "date" and returns appointments for that date.The date arg should be in "Y-m-d" format. Used with Appointments+ plugin
<?php
/*
Description: Copy file in mu-plugins folder. To be used with Appointments+ plugin. It accepts argument "date" and returns appointments for that date.The date arg should be in "Y-m-d" format.
*/
if( ! function_exists( 'appointments_get_appointments_for_day' ) ){
function appointments_get_appointments_for_day( $args = array() ) {
if( ! class_exists( 'Appointments' ) ){
@panoslyrakis
panoslyrakis / wpmudev-mp-weight-intrval.php
Created January 26, 2017 18:18
Show weight interval in cart
<?php
/*
Plugin Name: WPMU MP - Show weight interval
Plugin URI: http://premium.wpmudev.org/
Description: Show weight interval in cart
Version: 1.0.0
Author: Panos Lyrakis (WPMUDEV)
Author URI: http://premium.wpmudev.org
License: GNU General Public License (Version 2 - GPLv2)
*/