This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Capture a new member signup. Only ever triggers once for each new member. | |
//Does not trigger for exising members who have subscribed to a Membership before. | |
// | |
//The user may not be logged in when this is called | |
//as it is triggered when a user is added over the REST API, | |
//and also when a user is added from the dashboard (MemberPress -> Members -> Add New) | |
function mepr_capture_new_member_signup_completed($event) { | |
$user = $event->get_data(); | |
$txn_data = json_decode($event->args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'the_content', 'crd_append_post_links' ); | |
function crd_append_post_links( $content ) { | |
if ( is_page() ) { | |
$post_links_data = get_post_meta( get_the_ID() ); | |
if ( isset( $post_links_data[ 'blog_group' ][ 0 ] ) ) { | |
$blog_list = maybe_unserialize( $post_links_data[ 'blog_group' ][ 0 ] ); | |
$posts_list = '<ul>'; | |
foreach ( $blog_list as $post_info ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Shea\Example_Plugin; | |
/** | |
* Enable autoloading of plugin classes in namespace. | |
* | |
* @param $class_name | |
*/ | |
function autoload( $class_name ) { |