soushiken
Forum Replies Created
-
Nevermind, figured it out. Apparently, having “Edit” only enabled for the custom post type and disabled for “Posts” in general prevents listing them, unless “Create” is enabled for the custom post type. That’s weird and doesn’t really make sense, but as soon as “Edit” is checked for “Posts” and the custom post type, users can list and edit their own posts, but not submit new ones.
For anyone who needs a quick hack for the shortcode regarding this, in
includes/views/asl.shortcode.php
, locate the following line:
foreach ($style['selected-showcustomtypes'] as $k => $v) {
and insert the following filter before this line:
$style['customtypes'] = apply_filters('asl_filter_post_types', $style['customtypes']);
Then, in whatever page you need the shortcode filter, just call:
function search_filter_cpts($list) { return ["your-desired-post-type"]; } add_filter('asl_filter_post_types', 'search_filter_cpts'); echo do_shortcode('[wpdreams_ajaxsearchlite]');
and replace
your-desired-post-type
with whatever you want to pre-select here.Forum: Plugins
In reply to: [Ajax Search Lite - Live Search & Filter] Limit to CPTs?Hello,
is it also possible to un/select CPTs depending on the page? If I have archive pages for multiple CPTs (e.g., post types for fruits, vegetables) and on the archive page for fruits I want to only have fruits selected while for the vegetables archive, I only want to search through vegetables by default.
Thanks in advance!