| 开发者 | longislandfreelancewebdesigner |
|---|---|
| 更新时间 | 2026年11月19日 02:06 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[ajax_filter_search] shortcode anywhere./wp-json/afs/v1/feed, built from the same query as the results and listing published posts only.--afs-* CSS variable. Developers can override the item template and use filters.post_type - post type slug.post_tax - taxonomy slug used for the category tabs (or none).terms - comma separated term slugs to limit the feed to. (filter_by and filter_type are accepted as older names for the same thing.)posts_per_page - 1 to 100.layout - list or grid, the layout the feed starts in.orderby - date, title or modified. order - DESC or ASC.search - a keyword to start with. filter_years / filter_months - start on a year (for example 2025) or month (1 to 12).show_tabs, show_views, show_search, show_months, show_years - true or false.design - modern or classic. Overrides the Appearance setting for this feed.show_sort, show_chips - true or false. The sort control and the active filter chips are off unless you turn them on here, in the block, or under Settings.ajax-filter-search.zip from your computerajax-filter-search.zipajax-filter-search directory to your computerajax-filter-search directory to the /wp-content/plugins/ directory[ajax_filter_search], into your page.Yes. Add the terms attribute with the term slugs you want, separated by commas, for example [ajax_filter_search terms="news,events"]. Make sure the slugs belong to the taxonomy selected for that post type. (If you used filter_by with an older version, it still works.)
Yes, both are optional. Add show_sort="true" for a sort control and show_chips="true" for removable filter chips with a Clear all link (they also offer a way out when nothing matches). You can also use the matching block controls, or turn them on for every feed under Settings > Ajax Filter Search. They are off by default, so existing feeds look exactly as before.
Yes. /wp-json/afs/v1/feed accepts the same parameters as the results endpoint (for example afs_term=news&afs_year=2025) and returns RSS 2.0 with published posts only. Developers can build the address with afs_feed_url() or remove the feed with add_filter( 'afs_enable_feed', '__return_false' );.
No. A page that shows a feed and is opened with a filter, search or page number in the address is marked noindex, follow, so only the main page is indexed. You can turn this off under Settings > Ajax Filter Search or with the afs_noindex_filtered_states filter.
The filters call a read-only REST endpoint (/wp-json/afs/v1/results) that only ever returns published content of public post types. All incoming values are validated and sanitized on the server, and the endpoint cannot change anything on your site, so no nonce is needed.
Version 2.0.0 is a major update. Please back up your site and try it on a staging copy first. The feed has new markup and a small new stylesheet, so custom CSS written for the old Bootstrap-based markup needs updating, and the Font Awesome icon font is no longer loaded. Theme template overrides keep working. A compatibility layer keeps the 1.x functions, constants, the first feed's element IDs, the old script handles and the old ajax action working for now; it is deprecated and can be switched off with add_filter( 'afs_enable_legacy_compat', '__return_false' );. The filter_by attribute now limits a feed to category slugs, as the 1.x readme described; use search for a starting keyword. A short migration guide is in the plugin's GitHub repository (docs/MIGRATION-1.x-to-2.0.md).
Yes. Copy afs-template/default.php from the plugin folder into your-theme/afs-template/default.php (a child theme is checked first) and edit it. Templates written for version 1.x keep working. You can also use the afs_query_args and afs_template_file filters.
No. Version 1.x loaded Font Awesome from a CDN on every page. Version 2.0.0 loads nothing external.
Yes. The Classic design is the look of earlier versions, and sites that already use the plugin keep it. New installs start with the Modern design. Change it under Settings > Ajax Filter Search > Appearance, or for one feed with design="classic" or design="modern" (the block has a Design setting too).
Pick the accent color under Settings > Ajax Filter Search. For more control, set CSS variables in your theme, for example .afs { --afs-accent: #0a7; --afs-radius: 0; }.
The plugin's single settings option is removed when you delete the plugin. Your posts are never touched.
design="modern" on a feed, or the block's Design setting).show_sort="true", the block control or Settings.show_chips="true", the block control or Settings)./wp-json/afs/v1/feed. It uses the same query as the results and lists published posts only.meta block and, for logged-out visitors, sends cache validators so a repeat request is answered with an empty 304.afs_register action, afs_rest_response, afs_cache_version, afs_feed_url() and JavaScript hooks and events (afs:loaded, afs:results, afs:error).afs_query_args filter tries to widen the post status.terms, layout, orderby, order, search, show_tabs, show_views, show_search, show_months, show_years. filter_by now does what the old documentation said (limit to category slugs).--afs-* CSS variables.afs_query_args and afs_template_file filters.ajaxurl / scriptpath globals on feed pages. Switch it off with the afs_enable_legacy_compat filter.uninstall.php removes the plugin's setting on deletion.