function mepr_change_invoice_bill_to( $invoice, $txn ) { $user = $txn->user(); // Get company custom field. // Replace ‘mepr_company_name’ with the custom field slug. $company = get_user_meta( $user->ID, ‘mepr_company_name’, true ); // Return company name if not empty $name = ( !empty(…Continue reading
/** * Enables the HTTP Strict Transport Security (HSTS) header in WordPress. * Includes preloading with subdomain support. */ function tg_enable_strict_transport_security_hsts_header_wordpress() { header( ‘Strict-Transport-Security: max-age=31536000; includeSubDomains; preload’ ); } add_action( ‘send_headers’, ‘tg_enable_strict_transport_security_hsts_header_wordpress’ );Continue reading
use memberpress\courses\models as models; // Register classroom Styles function wpdocs_register_plugin_styles() { wp_enqueue_style( ‘mpcs-fontello-styles’, plugins_url( ‘memberpress-courses/public/fonts/fontello/css/mp-courses.css’ ) ); wp_enqueue_style( ‘mpcs-progress’, plugins_url( ‘memberpress-courses/public/css/progress.css’ ) ); } add_action( ‘wp_enqueue_scripts’, ‘wpdocs_register_plugin_styles’ ); // The “[mepr-mpcs-course-overview]” shortcode add_shortcode( ‘mepr-mpcs-course-overview’, function( $attributes ) { $content =…Continue reading
add_filter( ‘mpcs_classroom_style_handles’, function( $allowed_handles ) { $allowed_handles[] = ‘vjscss’; $allowed_handles[] = ‘ccpsacss’; return $allowed_handles; });Continue reading
/** * MemberPress – Generate Invoice Numbers for Zero Amount Transactions * * Creates invoice numbers for transactions with zero amounts to maintain * accounting consistency. */ function mepr_create_invoice_number( $event ) { // Fetch MemberPress options $mepr_options = MeprOptions::fetch(); //…Continue reading
/** * Plugin Name: Hide Author and Date * Plugin URI: * Description: A simple plugin to hide the author and publish date on the front end. * Version: 1.0.1 * Author: * License: GPL2 */ // Make sure we…Continue reading
/** * MemberPress – Exclude Specific Custom Fields from Signup Forms * * This code hides selected custom fields on MemberPress registration forms * when a specific URL parameter is present. */ add_filter( ‘mepr_render_custom_fields’, function( $fields ) { global $post;…Continue reading
/** * MemberPress – Customize Unauthorized Messages By User Status * * Displays different unauthorized messages based on whether the user is logged in * and if they have any active subscriptions. */ add_filter( ‘mepr-unauthorized-message’, function( $message ) { if…Continue reading