MemberPress: Free-Views-Used Counter

function mepr_display_cookie() { $free_views = isset( $_COOKIE[‘mp3pi141592pw’]) ? base64_decode( $_COOKIE[‘mp3pi141592pw’] ) : false; if( $free_views !== false ) { echo ‘You used ‘ . $free_views . ‘ free views!’; } } add_action( ‘init’, ‘mepr_display_cookie’ );Continue reading

MemberPress: Disable the Default WordPress Password Reset Link E-Mail

function mepr_disable_password_reset_email( $recipients, $subject, $message, $headers ) { $set_password_notification_subject = MeprHooks::apply_filters( ‘mepr_set_new_password_title’, sprintf( __( “[%s] Set Your New Password”, ‘memberpress’ ), MeprUtils::blogname() ) ); if ( $subject == $set_password_notification_subject ) { $recipients = array(); } return $recipients; } add_filter( ‘mepr-wp-mail-recipients’,…Continue reading

WPBakery Shortcode for the Post Excerpt with Limited Characters [vc_post_excerpt]

// WPBakery shortcode for the post excerpt with limited characters function vc_gitem_template_attribute_post_excerpt_with_link($value, $data) { extract(array_merge(array( ‘post’ => null, ‘data’ => ”, ), $data)); $excerpt = substr($post->post_content, 0, 150) . ‘…’; return ‘ ‘ . $excerpt . ‘ ‘; } add_filter(‘vc_gitem_template_attribute_vc_post_excerpt’,…Continue reading