fsimmons
Forum Replies Created
-
Yeah, no. I ended up with this which uses the plugin’s function members_can_current_user_view_post.
/** * Shortcode to conditionally display content based on Members plugin permissions. * * @param array $atts Shortcode attributes. * @param string|null $content Content inside the shortcode. * @return string Content if the user has permission, otherwise an empty string. */ function conditional_members_content_shortcode( $atts, $content = null ) { // Get the current post ID. $post_id = get_the_ID(); // Check if the current user can view the post. if ( members_can_current_user_view_post( $post_id ) ) { // Return the content if the user has permission. return do_shortcode( $content ); } else { // Optionally, return nothing or a message for users who don't have permission. return ''; } } // Register the shortcode add_shortcode( 'conditional_members_content', 'conditional_members_content_shortcode' );
And then I wrap my download box with [conditional_members_content][/conditional_members_content]. And it knows whatever role can see the content.
But thanks anyways, brotendo!
That seems to function like logged_in. If I set post to “member”, a “non-member” logged in account can is still read -> 1.
Interesting… so like…
if ( current_user_can( 'read' ) ) {
Would that align with page-level role restriction?
You solve this? Having same problem.
- This reply was modified 6 years, 6 months ago by fsimmons.
Forum: Plugins
In reply to: [Gravity Forms Salesforce Add-on] Multiple objects?Well, I can only tell you it was not easy to get running for us. In fact, we had to contribute code to the plugin to get it to do what we wanted.
email my username at gmail if you still can’t figure it out.
Forum: Plugins
In reply to: [Gravity Forms Salesforce Add-on] Multiple objects?Forms -> Settings -> Salesforce Add-on
What integration method are you using?Forum: Plugins
In reply to: [Gravity Forms Salesforce Add-on] Multiple objects?Do you have all the required fields within opportunity mapped?
And also (dumb question) the latest version of the plugin?
Forum: Plugins
In reply to: [WP Bannerize] arranging no more possibleJust realized Bannerize doesnt have impressions or clicks!! Yikes.
Forum: Plugins
In reply to: [WP Bannerize] arranging no more possibleNo, raumjournalismus. The new Bannerize does not share with old plugin. Just tried it.
Dammit. This sucks.
Forum: Plugins
In reply to: [Fleapay] [Plugin: Fleapay] Editing pages and posts diesHave you added a product within Fleapay? Once you do you get a “Embed Code Snippet” which you copy and paste into your post or page.
Forum: Plugins
In reply to: [Fleapay] [Plugin: Fleapay] Editing pages and posts diesNope.
Forum: Plugins
In reply to: [Fleapay] [Plugin: Fleapay] Editing pages and posts diesIf you dont have a ton of products, I would just use the new javascript embed instead. Flip over to HTML view and paste it when you want the button to show up.
Forum: Plugins
In reply to: [Plugin: ad-minister} alternativeBump! Looking for Ad-minister alternative.