Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterPerfect!
Okay, so based on all the information I got this:
add_filter( 'asp_query_args', function ( $args ) { $level_tag_map = array( 2 => array( 33 ), 3 => array( 34 ), ); $user_level = pmpro_getMembershipLevelForUser(); if ( $user_level === false ) { return $args; } if ( isset($level_tag_map[ $user_level->ID ]) ) { $args['post_tax_filter'][] = array( 'taxonomy' => 'post_tag', 'include' => $level_tag_map[ $user_level->ID ], 'allow_empty' => false, ); } return $args; }, 10, 1 );I couldn’t test it obviously, so please be careful.
Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi,
It’s inherited from the theme (usually the same as browser style). Drop-down styles are mostly not possible to change, but if you can add a relevan URL and let me know what you want to change exactly, I might be able to suggest some custom CSS for you.
June 25, 2024 at 9:08 am in reply to: If popup on compact layout isn't possible, then what alternatives? #48557Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou may have the wrong sources selected then. Make sure nothing is selected here, and the corresponind post types are selected on this option.
I guess elementor will sort out the rest.Ernest Marcinko
KeymasterYou are very welcome!
Ernest Marcinko
KeymasterHi,
I’m afraid this is out of scope of the plugin. The results page layout is controlled by the theme/page builder. Separating the archive query into multiple sections is probably not possible to do with page builders.
I have only seen a few solutions to this, and all of them were done via custom subqueries within the template files via custom code. Most of them had issues with pagination as well, so I don’t know if I recommend doing this unless you can code the template parts very well.
June 23, 2024 at 1:53 pm in reply to: If popup on compact layout isn't possible, then what alternatives? #48545Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterThank you!
I can’t seem to be able to replicate this. Can you please share what browser are you using?
I was testing on Chrome, Firefox, Opera GX and Edge, but all worked okay. The speed is also perfectly fine on my end, I’m measuring around 0.5s response times – which is actually very impressive.I recommend checking your browser addons. This issue sounds like there might be something wrong with the browser itself, and it’s usually caused by addons.
Ernest Marcinko
KeymasterOkay, now I understand it!
Can you please share the membership levels and the category IDs they can or can’t access?
With that I can probably construct something to add an exclusion to the query – by getting the user level and then appending the categories to exclude.Ernest Marcinko
KeymasterThanks!
The pmpro_hasMembershipLevel looks promising, but still need a way to check what level the current content is. I guess each post/item has a level and there is some way to retrieve that by the post ID?
With that a possible solution would be to:
– go through all the results in a loop
– get the access level of the post by it’s ID
– check if the user has access to that level
– remove it from the results if notThe only thing missing here is how to get the content level by it’s ID.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi Brendan,
I recall answering your question about that. Does that plugin have an API documentation which I can take a look? I couldn’t find anything meaningful with a quick google search. I looked at past support tickets, but apparently nobody had a similar query yet.
All we need is a simple method to check if the current user has access to a resource. I assume there is a very simple way – perhaps a function, hook, Class or anything similar.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts