• Resolved ravenso

    (@ravenso)


    Terrific work on this plugin, thanks.

    Have not tried this yet, but could the “User ID” be utilized instead of the “role” (or custom role)?

    In example, I have 50+ unique users: for each to see their respective content, 50 unique roles need to be created. Since users already have a unique ID, is there the option to utilize the existing User ID?

    I appreciate your time.

    • This topic was modified 5 years ago by ravenso.
Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Aldo Latino

    (@aldolat)

    Hello @ravenso,

    Terrific work on this plugin, thanks.
    […]
    I appreciate your time.

    You’re welcome and thanks! ??

    Have not tried this yet, but could the “User ID” be utilized instead of the “role” (or custom role)?

    You can use the username for this. For example:

    [private role="none" recipient="login-name"]Text for a specific user only[/private]

    Change login-name with the correct login name (username) of the target user.

    I wrote a wiki on GitHub, where you can find other information. The section where I explained the usage for your case is here.

    Let me know, please.

    Thread Starter ravenso

    (@ravenso)

    My sincere appreciation for a prompt reply!

    I did review the documentation on GitHub prior to my initial question…that’s why I inquired about utilizing the user ID, thinking the ID may be a simpler edit when inserting the [private…[/private], rather than role/none/login name.

    I also want to thank you for the excellent documentation for the plugin. It was a pleasure to review the thoroughly detailed information on WP and GitHub; I know that was a great deal of work.

    Best regards!

    Plugin Author Aldo Latino

    (@aldolat)

    I added an issue on GitHub – I will see if using the user ID is an enhancement that I could add without problems.

    Thanks for the appreciation! ??

    Best regards.

    songiuno

    (@songiuno)

    I don’t mean to jump in on someone else’s thread, but I’ve been following and that was an excellent question/request and support reply! I may have a desire to also use this restrict by specific user, either read only or the reverse role. There has been occasion for me to change a registered user’s username. If I use the reverse role to disallow user “james” user ID=5 from a post, and down the road he wants his username changed, it would break this restriction. Whereas, if by userid per the user database, that would remain a static assignment.

    Just a thought.

    Plugin Author Aldo Latino

    (@aldolat)

    Hello @songiuno ??
    I really appreciate when users give their contribution in other users’ thread, so you’re very welcome.

    I’ve taken some time before replying because I have tried to add (without breaking the other things) what you and @ravenso asked for. And I did it.

    Before releasing to the public, I would appreciate a feedback from you. If you have a test installation of WordPress, you can download the development package from here:
    https://codeload.github.com/aldolat/private-content/zip/develop

    The shortcode now supports the use of user IDs (along with usernames) in the recipient option.

    Let’s say that we have three users with these user IDs:
    – Alice: 1
    – Bob: 3
    – Charlie: 5

    Display a message to Alice:

    [private role="none" recipient="1"]Alice, this note is only for you.[/private]

    Display a message to all users, excluding Alice with an alternate message:

    [private role="none" recipient="1" reverse=1 alt="Alice, you cannot read this private text!"]All users, except Alice: this is a private text[/private]

    Display a message to Alice, Bob, and Charlie:

    [private role="none" recipient="5, 1, 3"]Alice, Bob, and Charlie: this note is only for you.[/private]

    Display a message to all users, excluding Alice, Bob, and Charlie:

    [private role="none" recipient="5, 1, 3" reverse=1]All users, except Alice, Bob, and Charlie: this is a private text[/private]

    Display a message to Alice, Bob, and Charlie, mixing usernames and IDs:

    [private role="none" recipient="5, alice, 3"]Alice, Bob, and Charlie: this note is only for you.[/private]

    Display a message to all users excluding Alice, Bob, and Charlie, mixing usernames and IDs:

    [private role="none" recipient="charlie, 1, 3" reverse=1]All users (excluding Alice, Bob, and Charlie): this note is for you only.[/private]

    Let me know if you can test it before the final release.

    Thanks in advance. ??

    songiuno

    (@songiuno)

    I don’t have a test site but will install and test on my live blog. I would think if the develop version breaks something I just deactivate/delete and reinstall the last release.

    Plugin Author Aldo Latino

    (@aldolat)

    Exact, @songiuno.

    Let me know, please.

    songiuno

    (@songiuno)

    I installed it, used shortcode for several user IDs in both recipient and recipient reverse and from all appearances works as expected. I don[‘t know if it is to ravenso’s satisfaction per original request for it.

    Thread Starter ravenso

    (@ravenso)

    Apologies everyone, I have been offline for two days. Thank you all for this followup; I did not anticipate making more work for anyone!

    I will test the code with my site in the next twenty-four hours and then chime in. But please do not postpone releasing the update on my account. I have no doubt the new implementation as impressive as the current release.

    Best

    Plugin Author Aldo Latino

    (@aldolat)

    @songiuno

    I installed it, used shortcode for several user IDs in both recipient and recipient reverse and from all appearances works as expected. I don[‘t know if it is to ravenso’s satisfaction per original request for it.

    Thank you for the precious feedback.

    @ravenso

    Apologies everyone, I have been offline for two days. Thank you all for this followup; I did not anticipate making more work for anyone!

    I will test the code with my site in the next twenty-four hours and then chime in. But please do not postpone releasing the update on my account. I have no doubt the new implementation as impressive as the current release.

    No problem! In these days, I can’t make any release for personal reasons, until Friday. Next weekend it could be possible for me, even if I won’t hear any news from you, so don’t worry. I’ll let you know here.

    Thanks all! ??

    Thread Starter ravenso

    (@ravenso)

    Hello friends!

    Wanted you to know I ran through each of Aldo’s scenarios as noted above (on a live site), and the plugin performed flawlessly. In addition to the excellent code and documentation, it also has given my site a new and effective method to handle private content, i.e., build a master page (rather than a private page for each registered user) and protect the registered user’s respective private content.

    Aldo, thank you, and to everyone who has contributed.

    Stay well, and best regards!

    Plugin Author Aldo Latino

    (@aldolat)

    Thank you so much for the feedback, @ravenso!

    I hope to make my routine tests in these days and release the new version.

    Bye ??

    Plugin Author Aldo Latino

    (@aldolat)

    … and thanks to @songiuno too! ??

    Plugin Author Aldo Latino

    (@aldolat)

    Hello all,
    The new 6.3 version has just been released and is on its way to all users.

    Thank you so much for your contributions! ??

    Plugin Author Aldo Latino

    (@aldolat)

    A message only to inform you that I added a PDF documentation to Private Content folder in the repository on GitHub. The PDF is downloadable from here.

    I don’t know if I can add it to the plugin on the WordPress repository, anyway it’s there on GitHub.

    Best Regards.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Private Role= versus Private User ID=’ is closed to new replies.