lbodden
Forum Replies Created
-
I actually got it to work, since the URIs are setup to be the same as the terms slugs i checked it to that and now search is properly being filtered. Here is the code in case anyone else comes across the same problem…
<div class="listings"> <?php while ( have_posts() ) { the_post(); $this_post_id = get_the_ID(); $terms = wp_get_post_terms( $this_post_id, 'wpbdp_category' ); foreach ($terms as $thisterm) { //echo $thisterm->term_id; if (!is_permitted_by_s2member ($thisterm->slug, "uri")){ continue 2; } } echo wpbdp_render_listing(null, 'excerpt'); /* added to keep list of what posts are on THIS page for google map */ $post_ids[] = get_the_ID(); } // end while ?> <div class="wpbdp-pagination">thats unfortunately what i’ve been banging my head against to try and get to work. i can get the custom post taxonomy terms but when checking against that function it doesn’t work. i have the exact matching IDs in the category restriction section of s2member.
$this_post_id = get_the_ID(); $terms = wp_get_post_terms( $this_post_id, 'wpbdp_category' ); foreach ($terms as $thisterm) { if (!is_permitted_by_s2member ($thisterm->term_id, "category")){ continue 2; } }btw thank you for you patience and help…
I do have alternative view protection on. Keep in mind the search being used, as I stated above, is not wordpress search functionality it is a built in search with business directory plugin
I also have all of that enabled but I need to restrict custom taxonomies to certain levels. I have already enabled URI restrictions which is great and works 100% when you are navigating around with links. But, when you search the URI restrictions are useless. I realize editing the core files is bad practice so i have moved to try and edit the template file displaying the posts. I edited this to no luck because as I have said before the categories are a custom taxonomy…
<div class="listings"> <?php while ( have_posts() ) { the_post(); $this_post_id = get_the_ID(); $category = get_the_category( $this_post_id ); if(!is_permitted_by_s2member ($category->cat_ID, "category")) continue; echo wpbdp_render_listing(null, 'excerpt'); /* added to keep list of what posts are on THIS page for google map */ $post_ids[] = get_the_ID(); } // end while ?>Thank you for your reply, I have realized that business directory makes the listings as a custom post type. This being said the categories created are custom taxonomies and when placing the category ids into
Dashboard -› s2Member® -› Restriction Options -› Category Access Restrictions
there is no change in protection. I read here that custom taxonomies are not supported. However, that was an old post. Is there any way to get custom taxonomies working for category restrictions other than tags?