Thanks for the great question/suggestion.No, s2Member does NOT make this particular feature available as of v3.2.9. s2Member's ability to handle Content Dripping is still limited to its API Constants and documentation made available in your Dashboard under:
s2Member -> API Scripting -> Content Dripping.
That being said, you could certainly implement this in a few different ways. Here is one idea for you.Using s2Member's Meta Box panel on your Post/Page editing forms, you could require specific Custom Capabilities for Posts/Pages that you plan to drip. So let's look at how I might handle this.
Title: An Example Post A
- require Custom Capability: 30days
Title: An Example Post B
- require Custom Capability: 60days
Title: An Example Post C
- require Custom Capability: 90days
So configuring this is pretty simple, as all of that functionality is already built-in with s2Member installed. The only thing left to deal with, is how to assign these Custom Capabilities on a per-User basis, based on how long they've been registered with your site.
You can use the sample script provided below as a starting point:
Save it here: /wp-content/mu-plugins/my-s2-cron-job.php- Code: Select all
<?php
function my_s2_cron_job ()
{
if ($_GET["my_s2_cron_job"])
{
foreach (get_users_of_blog () as $user)
{
$user = new WP_User ($user->ID);
if (strtotime ($user->user_registered) <= strtotime ("-30 days"))
$user->add_cap ("access_s2member_ccap_30days");
if (strtotime ($user->user_registered) <= strtotime ("-60 days"))
$user->add_cap ("access_s2member_ccap_60days");
if (strtotime ($user->user_registered) <= strtotime ("-90 days"))
$user->add_cap ("access_s2member_ccap_90days");
}
exit ();
}
}
add_action ("init", "my_s2_cron_job");
?>
You can run this script as a Cron job, once per day:
- Code: Select all
http://www.example.com/?my_s2_cron_job=1
OR: http://www.example.com/path/to/wordpress/?my_s2_cron_job=1