This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 15 posts - 2,236 through 2,250 (of 18,424 total)
  • Author
    Posts
  • in reply to: Restrict Results Based on Paid Memberships Pro Level #48560
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Perfect!

    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.

    in reply to: Search Speed #48559
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: edit t taxonomies search bar #48558
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    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.

    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: custom search results page with 2 results lists #48556
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You 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.

    in reply to: Blink effect #48555
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You are very welcome!

    in reply to: custom search results page with 2 results lists #48546
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    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.

    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Blink effect #48544
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Thank 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.

    in reply to: Restrict Results Based on Paid Memberships Pro Level #48543
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Okay, 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.

    in reply to: Restrict Results Based on Paid Memberships Pro Level #48537
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Thanks!

    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 not

    The only thing missing here is how to get the content level by it’s ID.

    in reply to: PDF Search results show only name of PDF #48534
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Restrict Results Based on Paid Memberships Pro Level #48533
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi 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.

    in reply to: Link Taxonomies with "or" #48532
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Design results while maintaining template style #48531
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 15 posts - 2,236 through 2,250 (of 18,424 total)