Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Reply To: Integration with Simple Press Forum?

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore General Questions › Integration with Simple Press Forum? › Reply To: Integration with Simple Press Forum?

January 25, 2010 at 8:31 am #17505
kettlewell
Member

Amin,

I checked into this further, and came up with some pseudo-code that should make this fairly simple for you to integrate…If this isn’t what you were looking for for code, let me know.

The code is obviously vague & generic, but you should see how it fits into your store plugin…

1. Display Dropdown

global $wp_roles;
$roles = array_keys($wp_roles->role_names)

if($roles)
{
foreach($roles as $index=>$role)
{
echo "<option>$role</option>";
}
}

2. On Save – Set per product option

$storeoption['prodnum']['role'] = $_POST['role_option'];

3. On User Create

$user = new WP_User($id);
$user->add_role($storeoption['prodnum']['role']);

Things to consider:

if a user exists (for another product perhaps?), then the highest role should be used.

If a product role changes (not a good idea, I know), then there should be an option to either change all users, or to set the new role from this point forward. (Or just pick one, and we can all live with it :) )

I hope that’s a bit more informative of what I’m looking for, and how you could implement it in your plugin.

If you intend to implement this, please let me know. Otherwise I’ll make plans to make due with a single membership forum.

Thanks

Matt

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ