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

How do I set emember permissions when submitting a post via a form?

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Tweaks › How do I set emember permissions when submitting a post via a form?

  • This topic has 5 replies, 2 voices, and was last updated 11 years, 2 months ago by Donna.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • March 6, 2014 at 6:47 pm #9968
    Donna
    Member

    Hi!

    I am using a plugin that replaces the WP Dashboard post editor with a form for my members to submit content to my site. I need to set the emember permissions for the post when the form is submitted. I can add custom fields to the form but I don’t know how to reference that emember field.

    Would this be done via a custom field? If so, what is the field name I should use? And would I set the default values to be numbers separated by commas? i.e. 2,3 (membership levels)

    Hope that made sense!

    Thanks!

    March 7, 2014 at 12:45 am #61342
    admin
    Keymaster

    This customization that you are doing is not going to be trivial unfortunately. emember sets permission through WordPress callback (when you save a post)… which will not be available in your case. It is not saved using custom fields.

    You can save protection for a post then investigate how it is saved in the database by going to it via PHPMyAdmin and inspecting the tables.

    March 7, 2014 at 8:57 pm #61343
    Donna
    Member

    Thank you both for your responses. I believe I have a simple workaround I just want to make sure I’m not missing something important.

    I have placed PHP emember code at the top of my single.php template file (it encompasses the entire page contents)….

    <?php if(wp_emember_is_member_logged_in(‘3’)||wp_emember_is_member_logged_in(‘4’)) { ?>

    So, even though the protection isn’t set when saving the post, the post template has the protection build into it. I have tested the process and it appears to work well and is adequate for my applicable. All “posts” will be using the same level of protection on my site anyway. Only “pages”, which use a different template file will require flexiblity with that. ;)

    My question for you is, have I lost any amount of security by doing it this way as opposed to physically setting the emember levels in the post editor? And if so, what?

    Also, I have just discovered phpMyAdmin triggers and believe I could successfully update the post protection there when the new post is inserted. However, after looking for the post level settings there, I still can’t find the fields that store that information. Can you please tell me where to find it?

    Thanks for your assistance,

    Donna

    March 7, 2014 at 10:16 pm #61344
    Donna
    Member

    Regarding the phpMyAdmin question: I finally found the field in question. So, I’m all set there.

    Still need to know if I’ve lost any amount of security by setting the emember security level in the template file as opposed to physically setting the emember levels in the post editor? And if so, what?

    Thanks again!

    March 7, 2014 at 10:53 pm #61345
    admin
    Keymaster

    You haven’t lost anything in my opinion.

    March 7, 2014 at 11:13 pm #61346
    Donna
    Member

    OK, great! Thanks!

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

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