Title: Conditional Activity Length
Last modified: August 22, 2016

---

# Conditional Activity Length

 *  Resolved [daltontastic](https://wordpress.org/support/users/daltontastic/)
 * (@daltontastic)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/conditional-activity-length/)
 * Is there a way to exclude certain users from the activity length restriction?
   I have a premium option on the site and I want them to have unlimited status 
   length.
 * [https://wordpress.org/plugins/bp-limit-activity-length/](https://wordpress.org/plugins/bp-limit-activity-length/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Mike Martel](https://wordpress.org/support/users/mike_cowobo/)
 * (@mike_cowobo)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/conditional-activity-length/#post-5232567)
 * Hi [@daltontastic](https://wordpress.org/support/users/daltontastic/),
 * There is no built-in way to quickly filter the activity length per user. However,
   you can prevent the plugin from loading when the user is premium:
 *     ```
       add_action( 'plugins_loaded', 'maybe_disable_bplal' );
       function maybe_disable_bplal() {
           if ( is_premium() ) {
               remove_action( 'bp_include', array( 'BP_LimitActivityLength', 'init' ) );
           }
       }
       ```
   
 * (assuming this code is loaded from a plugin)
 * Cheers,
    Mike
 *  Thread Starter [daltontastic](https://wordpress.org/support/users/daltontastic/)
 * (@daltontastic)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/conditional-activity-length/#post-5232583)
 * Okay so I symbolize which people are Premium by using modemlooper’s BuddyVerified
   Plugin…
 * So does that mean the code would look like this?
 * add_action( ‘plugins_loaded’, ‘maybe_disable_bplal’ );
    function maybe_disable_bplal(){
   if ( is_verified() ) { remove_action( ‘bp_include’, array( ‘BP_LimitActivityLength’,‘
   init’ ) ); } }
 * Also, where do I put the code?
 *  Plugin Author [Mike Martel](https://wordpress.org/support/users/mike_cowobo/)
 * (@mike_cowobo)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/conditional-activity-length/#post-5232603)
 * That sounds about right. Though I don’t think BuddyVerified comes with a `is_verified`
   function (correct me if I’m wrong). You’d have to write that function yourself..
   looking at the plugin quickly, that would be something like:
 *     ```
       function bp_is_verified() {
           $verified = get_user_meta( get_current_user_id(), 'bp-verified', true );
           return !empty( $verified );
       }
       ```
   
 * (untested!)
 * The best place to put all this is in a new plugin. That plugin could just contain
   these two functions and the `add_action` call.
 * Cheers,
    Mike

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Conditional Activity Length’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bp-limit-activity-length_7599a6.svg)
 * [BP Limit Activity Length](https://wordpress.org/plugins/bp-limit-activity-length/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bp-limit-activity-length/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bp-limit-activity-length/)
 * [Active Topics](https://wordpress.org/support/plugin/bp-limit-activity-length/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bp-limit-activity-length/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bp-limit-activity-length/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Mike Martel](https://wordpress.org/support/users/mike_cowobo/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/conditional-activity-length/#post-5232603)
 * Status: resolved