跳到内容

All Post Type Ajax Search

v1.1.0

Daniel Esparza · 2025年9月16日 上架

Real-time AJAX search. Choose in the admin which post types appear in the results. Shortcode: [all-post-type-ajax-search]

正在使用
10 以下
评分
暂无
累计下载
653
最近更新
2026年11月5日
需要 WordPress 5.0+已测试到 7.1.5PHP 7.2+

贡献者

截图

Settings: choose the post types and the default image.
Settings: choose the post types and the default image.
Front end: search box and results list (thumbnail, title, type).
Front end: search box and results list (thumbnail, title, type).
Example of the shortcode inside a page.
Example of the shortcode inside a page.
All Post Type Ajax Search
All Post Type Ajax Search
All Post Type Ajax Search

All Post Type Ajax Search adds a lightweight, secure search box that returns results in real time (AJAX). From the settings screen you choose exactly which content types (posts, pages, products and other custom post types) are included in the search. Each result shows a thumbnail (or a default image), the title and a link.

Main advantages:

  • Fast front-end search with up to 5 results and a minimum of 3 characters.
  • Full control from the admin: choose the post types that appear in the results.
  • Smart filtering that hides technical types (attachments, revisions, orders, variations, etc.).
  • Built following WordPress security best practices: nonces, sanitization and escaping.
  • Simple procedural code, easy to customize for developers of any level.
  • Translation ready (text domain: all-post-type-ajax-search).

Features

  1. Simple shortcode: [all-post-type-ajax-search].
  2. Admin settings: choose the enabled post types and set a default image (URL).
  3. Each result shows a thumbnail (or the default image), the title and a link.
  4. Results are spread across post types so posts or pages are not always shown first.
  5. Default limit of 5 results; searching starts at 3 characters.
  6. Performance: no_found_rows in queries, limited posts per query, and CSS/JS loaded only on pages that contain the shortcode.
  7. Security: nonces for AJAX and settings; capability checks (manage_options) in the admin.

Video

Additional Notes for Developers

  • Stored options:
    • aptas_search_post_types (array): enabled post types.
    • aptas_default_image_url (string): default image URL.
  • Nonces:
    • AJAX: aptas_search_nonce
    • Admin: aptas_settings_save (field name aptas_settings_nonce)
  • Shortcode: [all-post-type-ajax-search]
  • AJAX action: aptas_ajax_search (wp_ajax_aptas_ajax_search / wp_ajax_nopriv_aptas_ajax_search).

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums