{"id":328489,"date":"2026-06-18T03:33:19","date_gmt":"2026-06-18T03:33:19","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/hxse-code-first-search\/"},"modified":"2026-06-24T15:19:59","modified_gmt":"2026-06-24T15:19:59","slug":"hxse-code-first-search","status":"publish","type":"plugin","link":"https:\/\/hsb.wordpress.org\/plugins\/hxse-code-first-search\/","author":23511001,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.6.0","stable_tag":"1.6.0","tested":"7.0","requires":"6.0","requires_php":"7.4","requires_plugins":null,"header_name":"HXSE \u2014 Code-First Search","header_author":"Youhei Okubo","header_description":"Code-first search & filter for WordPress. Define filters with PHP arrays, output with a shortcode. Powered by htmx \u2014 no page reloads.","assets_banners_color":"050719","last_updated":"2026-06-24 15:19:59","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/okuboyouhei\/hxse-code-first-search","header_author_uri":"https:\/\/zenn.dev\/youheiokubo","rating":0,"author_block_rating":0,"active_installs":0,"downloads":302,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.1":{"tag":"1.0.1","author":"youheiokubo","date":"2026-06-18 03:32:41"},"1.0.2":{"tag":"1.0.2","author":"youheiokubo","date":"2026-06-19 03:37:32"},"1.1.0":{"tag":"1.1.0","author":"youheiokubo","date":"2026-06-20 03:40:26"},"1.2.0":{"tag":"1.2.0","author":"youheiokubo","date":"2026-06-20 09:26:11"},"1.4.0":{"tag":"1.4.0","author":"youheiokubo","date":"2026-06-21 02:40:27"},"1.5.0":{"tag":"1.5.0","author":"youheiokubo","date":"2026-06-21 21:18:22"},"1.6.0":{"tag":"1.6.0","author":"youheiokubo","date":"2026-06-24 15:19:59"}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3576510,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3576510,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3576510,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3576510,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.1","1.0.2","1.1.0","1.2.0","1.4.0","1.5.0","1.6.0"],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[221,1794,2236,944,80],"plugin_category":[43,59],"plugin_contributors":[266517],"plugin_business_model":[],"class_list":["post-328489","plugin","type-plugin","status-publish","hentry","plugin_tags-ajax","plugin_tags-custom-post-type","plugin_tags-filter","plugin_tags-search","plugin_tags-shortcode","plugin_category-customization","plugin_category-utilities-and-tools","plugin_contributors-youheiokubo","plugin_committers-youheiokubo"],"banners":{"banner":"https:\/\/ps.w.org\/hxse-code-first-search\/assets\/banner-772x250.png?rev=3576510","banner_2x":"https:\/\/ps.w.org\/hxse-code-first-search\/assets\/banner-1544x500.png?rev=3576510","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/hxse-code-first-search\/assets\/icon-128x128.png?rev=3576510","icon_2x":"https:\/\/ps.w.org\/hxse-code-first-search\/assets\/icon-256x256.png?rev=3576510","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>HXSE \u2014 Code-First Search lets you define search filters with PHP arrays and output them with a simple shortcode. No JavaScript configuration required. Powered by htmx for seamless, no-reload filtering.<\/p>\n\n<p><strong>Why HXSE?<\/strong><\/p>\n\n<ul>\n<li><strong>Code-first<\/strong> \u2014 Define everything in PHP arrays. Version-control friendly.<\/li>\n<li><strong>No page reloads<\/strong> \u2014 htmx handles all filtering and pagination seamlessly.<\/li>\n<li><strong>AI-friendly<\/strong> \u2014 Simple, consistent schema structure that AI agents can read and write.<\/li>\n<li><strong>No dependencies<\/strong> \u2014 htmx is bundled. No jQuery required.<\/li>\n<li><strong>Fully customizable<\/strong> \u2014 All styles use CSS custom properties (design tokens). Ships with <code>DESIGN.md<\/code> for a complete variable reference and customization examples.<\/li>\n<\/ul>\n\n<p><strong>Filter Types<\/strong><\/p>\n\n<ul>\n<li><code>search<\/code> \u2014 Keyword search<\/li>\n<li><code>taxonomy<\/code> \u2014 Filter by taxonomy \/ category<\/li>\n<li><code>meta<\/code> \u2014 Filter by custom field value or range<\/li>\n<li><code>date<\/code> \u2014 Filter by year<\/li>\n<li><code>relation<\/code> \u2014 Filter by related post<\/li>\n<\/ul>\n\n<p><strong>UI Types<\/strong><\/p>\n\n<ul>\n<li><code>select<\/code> \u2014 Dropdown<\/li>\n<li><code>radio<\/code> \u2014 Radio buttons<\/li>\n<li><code>checkbox<\/code> \u2014 Multiple selection<\/li>\n<li><code>range<\/code> \u2014 Min\/max slider (for numeric meta fields)<\/li>\n<\/ul>\n\n<p><strong>Pagination Modes<\/strong><\/p>\n\n<ul>\n<li><code>pager<\/code> \u2014 Numbered page links with count display<\/li>\n<li><code>loadmore<\/code> \u2014 \"Load more\" button<\/li>\n<\/ul>\n\n<p><strong>Basic Usage<\/strong><\/p>\n\n<p>Define a schema in your theme's <code>functions.php<\/code>:<\/p>\n\n<pre><code>add_filter( 'hxse_schemas', function( $schemas ) {\n    $schemas['staff_search'] = [\n        'post_type' =&gt; 'staff',\n        'filters'   =&gt; [\n            ['key' =&gt; 'keyword',    'type' =&gt; 'search',   'label' =&gt; '\u30ad\u30fc\u30ef\u30fc\u30c9'],\n            ['key' =&gt; 'department', 'type' =&gt; 'taxonomy',  'label' =&gt; '\u90e8\u7f72',\n                'taxonomy' =&gt; 'department',\n                'ui'       =&gt; 'checkbox',\n            ],\n        ],\n        'pagination' =&gt; [\n            'mode'     =&gt; 'pager',\n            'per_page' =&gt; 12,\n        ],\n        'template' =&gt; 'hxse-staff.php',\n    ];\n    return $schemas;\n} );\n<\/code><\/pre>\n\n<p>Then place the shortcode on any page:<\/p>\n\n<pre><code>[hxse id=\"staff_search\"]\n<\/code><\/pre>\n\n<h3>External Services<\/h3>\n\n<p>This plugin bundles htmx (https:\/\/htmx.org\/) for handling AJAX requests without page reloads. htmx is included locally within the plugin and does not make any external network requests. It is licensed under the BSD 2-Clause License.<\/p>\n\n<ul>\n<li>htmx: https:\/\/htmx.org\/<\/li>\n<li>htmx License: https:\/\/github.com\/bigskysoftware\/htmx\/blob\/master\/LICENSE<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>hxse-code-first-search<\/code> folder to <code>\/wp-content\/plugins\/<\/code>.<\/li>\n<li>Activate the plugin through the <strong>Plugins<\/strong> menu in WordPress.<\/li>\n<li>Add <code>hxse_schemas<\/code> filter to your theme's <code>functions.php<\/code> or a custom plugin.<\/li>\n<li>Add <code>[hxse id=\"your_schema_id\"]<\/code> shortcode to any page.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"do%20i%20need%20to%20write%20javascript%3F\"><h3>Do I need to write JavaScript?<\/h3><\/dt>\n<dd><p>No. HXSE handles all htmx configuration automatically. You only write PHP to define your filters.<\/p><\/dd>\n<dt id=\"can%20i%20use%20multiple%20search%20instances%20on%20one%20page%3F\"><h3>Can I use multiple search instances on one page?<\/h3><\/dt>\n<dd><p>Yes. Use the <code>prefix<\/code> option in <code>url_params<\/code> to avoid parameter conflicts.<\/p><\/dd>\n<dt id=\"how%20do%20i%20customize%20the%20result%20template%3F\"><h3>How do I customize the result template?<\/h3><\/dt>\n<dd><p>Create <code>hxse\/your-template.php<\/code> in your theme directory and specify it in the schema's <code>template<\/code> key.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20custom%20fields%20from%20acf%3F\"><h3>Does it work with custom fields from ACF?<\/h3><\/dt>\n<dd><p>Yes. Use <code>type: 'meta'<\/code> with the appropriate <code>meta_key<\/code>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.6.0<\/h4>\n\n<ul>\n<li>Added: iframe embed view \u2014 access <code>?hxse_embed={schema_id}<\/code> to output a list-only, self-contained HTML page for embedding on external landing pages<\/li>\n<li>Added: <code>embed<\/code> schema key \u2014 <code>enabled<\/code>, <code>allowed_origins<\/code>, <code>title<\/code>, <code>per_page<\/code><\/li>\n<li>Added: Clickjacking protection \u2014 <code>Content-Security-Policy: frame-ancestors<\/code> restricts which domains may embed the view (same-origin only when no origins are specified)<\/li>\n<li>Added: <code>includes\/embed.php<\/code> \u2014 embed view rendering and frame security headers<\/li>\n<\/ul>\n\n<h4>1.5.0<\/h4>\n\n<ul>\n<li>Added: Merge mode (<code>sources<\/code> key) \u2014 combine WordPress posts, RSS feeds, and APIs into a single chronological list<\/li>\n<li>Added: <code>hxse_fetch_merged_data()<\/code> \u2014 fetches, normalizes, and merges multiple data sources<\/li>\n<li>Added: Source normalizers for wp_query \/ rss \/ api \/ xml into a common format (title, link, date, excerpt, source, raw)<\/li>\n<li>Added: <code>orderby<\/code> \/ <code>order<\/code> \/ <code>limit<\/code> keys for merge mode sorting<\/li>\n<li>Added: <code>map<\/code> key \u2014 maps API\/XML response keys to the common format<\/li>\n<li>Added: <code>templates\/merged.php<\/code> \u2014 default template with source badges<\/li>\n<li>Added: Merge list styles in hxse.css<\/li>\n<\/ul>\n\n<h4>1.4.0<\/h4>\n\n<ul>\n<li>Added: <code>source: 'rss'<\/code> mode \u2014 fetches RSS 2.0 and Atom feeds and converts to PHP array automatically<\/li>\n<li>Added: <code>source: 'xml'<\/code> mode \u2014 fetches any XML and converts to PHP array using <code>xpath<\/code> key<\/li>\n<li>Added: <code>hxse_parse_rss()<\/code> \u2014 RSS 2.0 \/ Atom parser<\/li>\n<li>Added: <code>hxse_parse_xml()<\/code> \u2014 generic XML parser with xpath support<\/li>\n<li>Added: <code>hxse_simplexml_to_array()<\/code> \u2014 recursive SimpleXMLElement to array converter<\/li>\n<li>Improved: <code>hxse_do_remote_fetch()<\/code> now handles json \/ rss \/ xml based on <code>source<\/code> key<\/li>\n<li>Improved: backward-compatible <code>hxse_do_api_request()<\/code> alias retained<\/li>\n<\/ul>\n\n<h4>1.3.0<\/h4>\n\n<ul>\n<li>Added: Cache mapping (<code>hxse_cache_map<\/code> option) \u2014 tracks schema ID \u2192 filename relationships to detect orphaned files<\/li>\n<li>Added: Orphan file detection \u2014 warns when JSON files exist without a corresponding schema<\/li>\n<li>Added: \"\u4eca\u3059\u3050\u66f4\u65b0\" button \u2014 manually re-fetches API and regenerates JSON from admin UI (API schemas only)<\/li>\n<li>Added: Bulk delete all cache button with total file size display<\/li>\n<li>Added: Delete orphaned files button in admin UI<\/li>\n<li>Improved: <code>hxse_delete_static_cache()<\/code> now also removes the mapping entry<\/li>\n<li>Improved: <code>uninstall.php<\/code> now also deletes the <code>hxse_cache_map<\/code> option<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>Added: <code>cache_mode: 'static'<\/code> \u2014 saves API responses as JSON files in <code>wp-content\/hxse-cache\/<\/code> (blocked from web access via .htaccess)<\/li>\n<li>Added: <code>cache_file<\/code> key \u2014 custom filename for the static JSON cache<\/li>\n<li>Added: <code>includes\/cache.php<\/code> \u2014 cache directory management (init, load, save, delete)<\/li>\n<li>Added: Admin UI \u2014 static JSON cache list with individual delete buttons (Settings \u2192 HXSE)<\/li>\n<li>Added: <code>uninstall.php<\/code> \u2014 removes <code>wp-content\/hxse-cache\/<\/code> directory on plugin uninstall<\/li>\n<li>Improved: refactored <code>hxse_fetch_api_data()<\/code> to support both transient and static cache modes<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Added: <code>source: 'api'<\/code> mode \u2014 fetch data from external APIs (GAS, REST API, etc.) via PHP and render with a custom theme template<\/li>\n<li>Added: <code>token<\/code> key \u2014 appended as <code>_token<\/code> GET parameter for simple API authentication<\/li>\n<li>Added: <code>cache<\/code> key \u2014 transient-based caching for API responses (seconds, 0 to disable)<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Added: SECURITY.md \u2014 security policy, vulnerability reporting, and disclosure timeline<\/li>\n<li>Added: MAINTENANCE.md \u2014 architecture overview, htmx update steps, and fork guide<\/li>\n<li>Docs: Updated ai-reference.md \u2014 added design philosophy and maintainability section for AI agents<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Grid columns now controllable via <code>columns<\/code> schema key (CSS variable injection).<\/li>\n<li>Table headers customizable via <code>table_columns<\/code> schema key.<\/li>\n<li>Assets now loaded only on pages containing the [hxse] shortcode.<\/li>\n<li>Refactored hxse.js: replaced var with const\/let.<\/li>\n<li>Taxonomy conditions now auto-detect slug vs term_id.<\/li>\n<li>Fixed: escape the_title() in templates for XSS hardening.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<li>Filter types: search, taxonomy, meta, date, relation.<\/li>\n<li>UI types: select, radio, checkbox, range.<\/li>\n<li>URL parameter sync with browser history support.<\/li>\n<\/ul>","raw_excerpt":"Code-first search &amp; filter for WordPress. Define filters with PHP arrays, output with a shortcode. Powered by htmx \u2014 no page reloads.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/328489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=328489"}],"author":[{"embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/youheiokubo"}],"wp:attachment":[{"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=328489"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=328489"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=328489"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=328489"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=328489"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/hsb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=328489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}