Skip to content

Instantly share code, notes, and snippets.

@panoslyrakis
panoslyrakis / custom-feed-reader.php
Last active August 10, 2017 17:10
It will try fetch feeds with file_get_contents() instead of using simplepie
<?php
/*
Plugin Name: Custom Feed Importer
Plugin URI: https://premium.wpmudev.org/
Description: It will try fetch feeds with file_get_contents
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@panoslyrakis
panoslyrakis / ps-checkout-shortcode.php
Created August 5, 2017 16:21
Provides a shortcode to add the Pro Sites checkout form in any page
<?php
/*
Plugin Name: Pro Sites - Checkout Shortcode
Plugin URI: https://premium.wpmudev.org/
Description: Provides a shortcode to add the Pro Sites checkout form in any page
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@panoslyrakis
panoslyrakis / m2-protect-post-excerpt-in-archive.php
Created August 2, 2017 15:00
Hide the excerpt in the archive list
<?php
add_filter( 'the_excerpt', '_wpmudev_ms_custom_content_protection', 20, 1 );
add_filter( 'the_content', '_wpmudev_ms_custom_content_protection', 20, 1 );
function _wpmudev_ms_custom_content_protection( $content ){
global $post;
if( ! $post instanceof WP_Post || ! is_archive() ){
return $content;
@panoslyrakis
panoslyrakis / ms2-payment-notification.php
Created July 31, 2017 11:44
Adds payment notices to members that have not paid for subscriptions
<?php
/*
Plugin Name: Membership - Add payment notices
Plugin URI: https://premium.wpmudev.org/
Description: Adds payment notices to members that have not paid
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
@panoslyrakis
panoslyrakis / events-metabox-for-address.php
Created July 25, 2017 11:48
Add PostalAddress metabox to events. Can be used in events schema
<?php
/*
Plugin Name: WPMUDEV - Events PostalAddress
Plugin URI: https://premium.wpmudev.org/
Description: Add PostalAddress metabox to events
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
@panoslyrakis
panoslyrakis / custom-attachments-list.php
Created July 24, 2017 21:26
List images and sort them by term via ajax
<?php
/*
Plugin Name: WPMUDEV - List Attachmetns
Plugin URI: https://premium.wpmudev.org/
Description: List attachments and sort them via ajax
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
@panoslyrakis
panoslyrakis / ms-default-registration-page.php
Last active November 6, 2018 17:38
Membership2 - Use default registration page
<?php
/*
Plugin Name: Membership2 - Use default registration page
Plugin URI: https://premium.wpmudev.org/
Description: Use the WordPress default registration page
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
@panoslyrakis
panoslyrakis / mp-hide-address-section-in-checkout.phpt
Created July 13, 2017 10:46
Hide address section in MarketPress checkout page
<?php
add_filter( 'mp_checkout/sections_array', function( $sections ){
if( isset( $sections['billing-shipping-address'] ) ){
unset( $sections['billing-shipping-address'] );
}
return $sections;
}, 10 );
@panoslyrakis
panoslyrakis / app-redirect-to-checkout-page.php
Created July 13, 2017 10:43
Redirect to checkout page after appointment made
<?php
//Requires App+ and MarketPress
add_action( 'wp_footer', function(){
global $post;
if( ! $post instanceof WP_Post || strpos( $post->post_content, '[app_' ) === false || ! function_exists('mp_store_page_url') ){
return;
}
@panoslyrakis
panoslyrakis / ps-notice-by-level.php
Created July 1, 2017 14:57
Pro Sites - Notification for pro site owners
<?php
/*
Plugin Name: Pro Sites - Notification for pro site owners
Plugin URI: https://premium.wpmudev.org/
Description: Displays different notifications for users if they are logged out, logged in but don't have a pro site, logged in and have at least one pro site.
Author: Panos Lyrakis @ WPMUDEV
Author URI: https://premium.wpmudev.org/
License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {