What's the best way to do this?

ok, so here we go.

I'm wanting to show a video to those who have the 'Pro Member' of 'Film Maker' subscription. The Pro Member I don't have a problem with, just use the shortcode for the level, but the Film Maker subscription is a private subscription which I give manually (to those who have provided us with video). To enable this, I have set it on the 'Visitor' level, as it will be given to them once they have signed up for an account in the normal way, using the Buddypress signup. Also, Pro Member is in two different subscriptions, depending on whether they pay monthly or annually, due to a previous problem with getting both options on a single subscription.

What would I do to show the video to members on both these subscriptions, but nobody else?

  • Jonathan
    • The Incredible Code Injector

    Joe, try your hand at creating a shortcode using this...

    if ( (current_user_on_subscription(2) || current_user_on_subscription(3)) ) {
    // TRUE THEY ARE
    				} else {
    				// FALSE THEY ARE NOT
    				}

    Something like this...

    <?php
    /*
    Plugin Name: Membership Addon Multiple Subscription Shortcode
    Plugin URI: None
    Description: Adds the ability to protect two subscriptions.
    Version: 0.1
    Author: None
    Author URI: None
    License: None
    */
    function membership_sub_protect( $atts, $content = null ) {
    
    	extract( shortcode_atts( array(
          'subidone' => '1',
          'subidtwo' => '2',
          'message' => 'Sorry this is protected for members that have uploaded video',
          ), $atts ) );
    
    	//also available: current_user_on_subscription()
    	if ( current_user_on_subscription($subidone) || current_user_on_subscription($subidtwo) ) {
    		return $content;
    	}
    	else { return $message;}
    }
    add_shortcode('membership-sub-protect', 'membership_sub_protect');
    ?>

    USAGE:

    [membership-level subidone="2" subidtwo="3" message="My Custom No Access Message Goes Here!"]
    This content should be hidden to membership levels other than 2.
    [/membership-level]

    Above is untested and this isn't ideal coding environment. Good luck

  • aecnu
    • WP Unicorn

    Greetings Joe,

    We have not heard back from you as to the status of this issue.

    If you are still having an issue please let us know so that we may try to get you fixed up as soon as possible by choosing to check mark this ticket as unresolved below and posting any new errors or symptoms you are noticing.

    This action will also bring your ticket up front back in plain view again within the ticket system.

    Thank you for being a WPMU Dev member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.