How to display expiration day in a page ?

Hello,

I would like to insert either the number of day before expiration or the expiration date in a text on a page.

Can you give me the shortcode I have to use ?

Regards,

  • Vaughan

    Hi @AAE ISUP,

    Hope you're well?

    There isn't currently a shortcode for this.

    You would need to create a shortcode to use.

    You can try this;

    /wp-content/plugins/membership/app/controller/class-ms-controller-shortcode.php

    Find the following code (around line 1803)

    case 'email':
    				$content = $member->email;
    				break;
    
    			case 'firstname':
    			case 'first name':
    				$content = $member->first_name;
    				break;
    
    			case 'lastname':
    			case 'last name':
    				$content = $member->last_name;
    				break;

    add the following into it, so you have;

    case 'email':
    				$content = $member->email;
    				break;
    
                case 'expiry':
                    foreach ( $member->subscriptions as $subscription ) {
                        $content = $subscription->expire_date;
                    }
                    break;
    
    			case 'firstname':
    			case 'first name':
    				$content = $member->first_name;
    				break;
    
    			case 'lastname':
    			case 'last name':
    				$content = $member->last_name;
    				break;

    Now hopefully you should be able to use the member info shortcode like below;

    [ms-member-info value="expiry" before="Expiry date"]

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.