# Drip Content by Registration Date

> Adds a [wpide_drip days="7"] shortcode that unlocks the content inside it a set number of days after each member registered, and tells them when it unlocks.

- Type: PHP
- Runs: Run everywhere
- Category: [Memberships](https://wpide.com/library/category/memberships/)
- Tags: drip, members, shortcode
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/drip-content-shortcode/

## Code

```php
add_shortcode( 'wpide_drip', function ( $atts, $content = '' ) {
    $atts = shortcode_atts( array( 'days' => 0, 'locked' => 'This part unlocks on %s.' ), $atts, 'wpide_drip' );

    if ( ! is_user_logged_in() ) {
        return '<p class="wpide-drip-locked">Please <a href="' . esc_url( wp_login_url( get_permalink() ) ) . '">log in</a> to see this content.</p>';
    }

    if ( current_user_can( 'edit_others_posts' ) ) {
        return do_shortcode( $content );
    }

    $unlocks = strtotime( wp_get_current_user()->user_registered . ' UTC' ) + max( 0, (int) $atts['days'] ) * DAY_IN_SECONDS;

    if ( time() >= $unlocks ) {
        return do_shortcode( $content );
    }

    return '<p class="wpide-drip-locked">' . esc_html( sprintf( $atts['locked'], wp_date( get_option( 'date_format' ), $unlocks ) ) ) . '</p>';
} );
```

## Notes

Example: [wpide_drip days="14"]Week 3 lesson[/wpide_drip]. Administrators and editors always see the content.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Drip Content by Registration Date" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
