diff --git a/README.md b/README.md index f543ef9..9d8c5b9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,11 @@ This plugin allows you to easily add filters to any query loop block. -Provides 2 new blocks that can be added within a query loop block to allow filtering by either post type or a taxonomy. Also supports using the core search block to allow you to search. +Provides 2 new blocks that can be added within a query loop block to allow filtering by either post type or a taxonomy. + +Additions to the search block: +- It supports using the core search block to allow you to search. +- It includes search in the custom fields of the post. Compatible with both the core query loop block and the [Advanced query loop plugin](https://wordpress.org/plugins/advanced-query-loop/) (In fact, in order to use post type filters, use of the Advanced Query Loop plugin is required). diff --git a/build/post-type/index.js.map b/build/post-type/index.js.map index 899ee83..f57c4bb 100644 --- a/build/post-type/index.js.map +++ b/build/post-type/index.js.map @@ -1 +1 @@ -{"version":3,"file":"post-type/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACsC;AACG;AAClC;AAAA;AAE7B,SAASa,IAAIA,CAAE;EAAEC,UAAU;EAAEC,aAAa;EAAEC;AAAQ,CAAC,EAAG;EACtE,MAAM;IAAEC,UAAU;IAAEC,KAAK;IAAEC;EAAU,CAAC,GAAGL,UAAU;EAEnD,MAAMM,YAAY,GAAGd,0DAAS,CAAIe,MAAM,IAAM;IAC7C,OACC,CAAEA,MAAM,CAAE,MAAO,CAAC,CAACC,YAAY,CAAE;MAAEC,QAAQ,EAAE;IAAI,CAAE,CAAC,IAAI,EAAE,EAAGC,MAAM,CAChEC,IAAI,IAAMA,IAAI,CAACC,QAClB,CAAC,IAAI,EAAE;EAET,CAAC,EAAE,EAAG,CAAC;EAEP,IAAIC,gBAAgB,GAAG,CAAEX,OAAO,CAACY,KAAK,CAACC,QAAQ,IAAI,EAAE,EACnDC,KAAK,CAAE,GAAI,CAAC,CACZC,GAAG,CAAIN,IAAI,IAAMA,IAAI,CAACO,IAAI,CAAC,CAAE,CAAC;;EAEhC;EACA,IAAKC,KAAK,CAACC,OAAO,CAAElB,OAAO,CAACY,KAAK,CAACO,cAAe,CAAC,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C;AACD;AACA;EACCC,IAAI,EAAExC,6CAAIA;AACX,CAAE,CAAC,C","sources":["webpack://query-loop-filter/./src/post-type/edit.js","webpack://query-loop-filter/external window \"ReactJSXRuntime\"","webpack://query-loop-filter/external window [\"wp\",\"blockEditor\"]","webpack://query-loop-filter/external window [\"wp\",\"blocks\"]","webpack://query-loop-filter/external window [\"wp\",\"components\"]","webpack://query-loop-filter/external window [\"wp\",\"data\"]","webpack://query-loop-filter/external window [\"wp\",\"i18n\"]","webpack://query-loop-filter/webpack/bootstrap","webpack://query-loop-filter/webpack/runtime/compat get default export","webpack://query-loop-filter/webpack/runtime/define property getters","webpack://query-loop-filter/webpack/runtime/hasOwnProperty shorthand","webpack://query-loop-filter/webpack/runtime/make namespace object","webpack://query-loop-filter/./src/post-type/index.js"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { useBlockProps, InspectorControls } from '@wordpress/block-editor';\nimport { PanelBody, TextControl, ToggleControl } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( { attributes, setAttributes, context } ) {\n\tconst { emptyLabel, label, showLabel } = attributes;\n\n\tconst allPostTypes = useSelect( ( select ) => {\n\t\treturn (\n\t\t\t( select( 'core' ).getPostTypes( { per_page: 100 } ) || [] ).filter(\n\t\t\t\t( type ) => type.viewable\n\t\t\t) || []\n\t\t);\n\t}, [] );\n\n\tlet contextPostTypes = ( context.query.postType || '' )\n\t\t.split( ',' )\n\t\t.map( ( type ) => type.trim() );\n\n\t// Support for enhanced query loop block plugin.\n\tif ( Array.isArray( context.query.multiple_posts ) ) {\n\t\tcontextPostTypes = contextPostTypes.concat(\n\t\t\tcontext.query.multiple_posts\n\t\t);\n\t}\n\n\tconst postTypes = contextPostTypes.map( ( postType ) => {\n\t\treturn (\n\t\t\tallPostTypes.find( ( type ) => type.slug === postType ) || {\n\t\t\t\tslug: postType,\n\t\t\t\tname: postType,\n\t\t\t}\n\t\t);\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t setAttributes( { label } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { showLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { emptyLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t{ showLabel && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{ postTypes.map( ( type ) => (\n\t\t\t\t\t\t\n\t\t\t\t\t) ) }\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n","module.exports = window[\"ReactJSXRuntime\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport Edit from './edit';\nimport metadata from './block.json';\n\nregisterBlockType( metadata.name, {\n\t/**\n\t * @see ./edit.js\n\t */\n\tedit: Edit,\n} );\n"],"names":["__","useBlockProps","InspectorControls","PanelBody","TextControl","ToggleControl","useSelect","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","setAttributes","context","emptyLabel","label","showLabel","allPostTypes","select","getPostTypes","per_page","filter","type","viewable","contextPostTypes","query","postType","split","map","trim","Array","isArray","multiple_posts","concat","postTypes","find","slug","name","children","title","value","defaultValue","help","onChange","checked","placeholder","className","inert","registerBlockType","metadata","edit"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"post-type/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACsC;AACG;AAClC;AAAA;AAE7B,SAASa,IAAIA,CAAE;EAAEC,UAAU;EAAEC,aAAa;EAAEC;AAAQ,CAAC,EAAG;EACtE,MAAM;IAAEC,UAAU;IAAEC,KAAK;IAAEC;EAAU,CAAC,GAAGL,UAAU;EAEnD,MAAMM,YAAY,GAAGd,0DAAS,CAAIe,MAAM,IAAM;IAC7C,OACC,CAAEA,MAAM,CAAE,MAAO,CAAC,CAACC,YAAY,CAAE;MAAEC,QAAQ,EAAE;IAAI,CAAE,CAAC,IAAI,EAAE,EAAGC,MAAM,CAChEC,IAAI,IAAMA,IAAI,CAACC,QAClB,CAAC,IAAI,EAAE;EAET,CAAC,EAAE,EAAG,CAAC;EAEP,IAAIC,g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AC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACNsD;AAC5B;AACU;AAEpCY,oEAAiB,CAAEC,6CAAa,EAAE;EACjC;AACD;AACA;EACCC,IAAI,EAAExC,6CAAIA;AACX,CAAE,CAAC,C","sources":["webpack://query-loop-filter/./src/post-type/edit.js","webpack://query-loop-filter/external window [\"wp\",\"blockEditor\"]","webpack://query-loop-filter/external window [\"wp\",\"blocks\"]","webpack://query-loop-filter/external window [\"wp\",\"components\"]","webpack://query-loop-filter/external window [\"wp\",\"data\"]","webpack://query-loop-filter/external window [\"wp\",\"i18n\"]","webpack://query-loop-filter/external window \"ReactJSXRuntime\"","webpack://query-loop-filter/webpack/bootstrap","webpack://query-loop-filter/webpack/runtime/compat get default export","webpack://query-loop-filter/webpack/runtime/define property getters","webpack://query-loop-filter/webpack/runtime/hasOwnProperty shorthand","webpack://query-loop-filter/webpack/runtime/make namespace object","webpack://query-loop-filter/./src/post-type/index.js"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { useBlockProps, InspectorControls } from '@wordpress/block-editor';\nimport { PanelBody, TextControl, ToggleControl } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( { attributes, setAttributes, context } ) {\n\tconst { emptyLabel, label, showLabel } = attributes;\n\n\tconst allPostTypes = useSelect( ( select ) => {\n\t\treturn (\n\t\t\t( select( 'core' ).getPostTypes( { per_page: 100 } ) || [] ).filter(\n\t\t\t\t( type ) => type.viewable\n\t\t\t) || []\n\t\t);\n\t}, [] );\n\n\tlet contextPostTypes = ( context.query.postType || '' )\n\t\t.split( ',' )\n\t\t.map( ( type ) => type.trim() );\n\n\t// Support for enhanced query loop block plugin.\n\tif ( Array.isArray( context.query.multiple_posts ) ) {\n\t\tcontextPostTypes = contextPostTypes.concat(\n\t\t\tcontext.query.multiple_posts\n\t\t);\n\t}\n\n\tconst postTypes = contextPostTypes.map( ( postType ) => {\n\t\treturn (\n\t\t\tallPostTypes.find( ( type ) => type.slug === postType ) || {\n\t\t\t\tslug: postType,\n\t\t\t\tname: postType,\n\t\t\t}\n\t\t);\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t setAttributes( { label } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { showLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { emptyLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t{ showLabel && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{ postTypes.map( ( type ) => (\n\t\t\t\t\t\t\n\t\t\t\t\t) ) }\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport Edit from './edit';\nimport metadata from './block.json';\n\nregisterBlockType( metadata.name, {\n\t/**\n\t * @see ./edit.js\n\t */\n\tedit: Edit,\n} );\n"],"names":["__","useBlockProps","InspectorControls","PanelBody","TextControl","ToggleControl","useSelect","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","setAttributes","context","emptyLabel","label","showLabel","allPostTypes","select","getPostTypes","per_page","filter","type","viewable","contextPostTypes","query","postType","split","map","trim","Array","isArray","multiple_posts","concat","postTypes","find","slug","name","children","title","value","defaultValue","help","onChange","checked","placeholder","className","inert","registerBlockType","metadata","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/build/taxonomy/index.js.map b/build/taxonomy/index.js.map index 4898e71..28b4b3a 100644 --- a/build/taxonomy/index.js.map +++ b/build/taxonomy/index.js.map @@ -1 +1 @@ -{"version":3,"file":"taxonomy/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACsC;AAM5C;AACa;AAAA;AAE7B,SAASc,IAAIA,CAAE;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAG;EAC7D,MAAM;IAAEC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AK,CACD,CACP,eACDR,uDAAA;QACCmC,SAAS,EAAC,sEAAsE;QAChFC,KAAK;QAAAZ,QAAA,gBAEL1B,sDAAA;UAAA0B,QAAA,EACGjB,UAAU,IAAIlB,mDAAE,CAAE,KAAK,EAAE,cAAe;QAAC,CACpC,CAAC,EACPgC,KAAK,CAACO,GAAG,CAAIS,IAAI,iBAClBvC,sDAAA;UAAA0B,QAAA,EAA4Ba,IAAI,CAACjB;QAAI,GAAvBiB,IAAI,CAAClB,IAA4B,CAC9C,CAAC;MAAA,CACI,CAAC;IAAA,CACL,CAAC;EAAA,CACL,CAAC;AAEL;;;;;;;;;;;AC5GA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;ACNsD;AAC5B;AACU;AACT;AAE3BmB,oEAAiB,CAAEC,6CAAa,EAAE;EACjC;AACD;AACA;EACCC,IAAI,EAAErC,6CAAIA;AACX,CAAE,CAAC,C","sources":["webpack://query-loop-filter/./src/taxonomy/edit.js","webpack://query-loop-filter/./src/taxonomy/style-index.css?27a5","webpack://query-loop-filter/external window \"ReactJSXRuntime\"","webpack://query-loop-filter/external window [\"wp\",\"blockEditor\"]","webpack://query-loop-filter/external window [\"wp\",\"blocks\"]","webpack://query-loop-filter/external window [\"wp\",\"components\"]","webpack://query-loop-filter/external window [\"wp\",\"data\"]","webpack://query-loop-filter/external window [\"wp\",\"i18n\"]","webpack://query-loop-filter/webpack/bootstrap","webpack://query-loop-filter/webpack/runtime/compat get default export","webpack://query-loop-filter/webpack/runtime/define property getters","webpack://query-loop-filter/webpack/runtime/hasOwnProperty shorthand","webpack://query-loop-filter/webpack/runtime/make namespace object","webpack://query-loop-filter/./src/taxonomy/index.js"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { useBlockProps, InspectorControls } from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tSelectControl,\n\tTextControl,\n\tToggleControl,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( { attributes, setAttributes } ) {\n\tconst { taxonomy, emptyLabel, label, showLabel } = attributes;\n\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst results = (\n\t\t\t\tselect( 'core' ).getTaxonomies( { per_page: 100 } ) || []\n\t\t\t).filter( ( taxonomy ) => taxonomy.visibility.public );\n\n\t\t\tif ( results && results.length > 0 && ! taxonomy ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ttaxonomy: results[ 0 ].slug,\n\t\t\t\t\tlabel: results[ 0 ].name,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn results;\n\t\t},\n\t\t[ taxonomy ]\n\t);\n\n\tconst terms = useSelect(\n\t\t( select ) => {\n\t\t\treturn (\n\t\t\t\tselect( 'core' ).getEntityRecords( 'taxonomy', taxonomy, {\n\t\t\t\t\tnumber: 50,\n\t\t\t\t} ) || []\n\t\t\t);\n\t\t},\n\t\t[ taxonomy ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t ( {\n\t\t\t\t\t\t\tlabel: taxonomy.name,\n\t\t\t\t\t\t\tvalue: taxonomy.slug,\n\t\t\t\t\t\t} ) ) }\n\t\t\t\t\t\tonChange={ ( taxonomy ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\ttaxonomy,\n\t\t\t\t\t\t\t\tlabel: taxonomies.find(\n\t\t\t\t\t\t\t\t\t( tax ) => tax.slug === taxonomy\n\t\t\t\t\t\t\t\t).name,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { label } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { showLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { emptyLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t{ showLabel && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{ terms.map( ( term ) => (\n\t\t\t\t\t\t\n\t\t\t\t\t) ) }\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"ReactJSXRuntime\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport Edit from './edit';\nimport metadata from './block.json';\nimport './style-index.css';\n\nregisterBlockType( metadata.name, {\n\t/**\n\t * @see ./edit.js\n\t */\n\tedit: Edit,\n} );\n"],"names":["__","useBlockProps","InspectorControls","PanelBody","SelectControl","TextControl","ToggleControl","useSelect","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","setAttributes","taxonomy","emptyLabel","label","showLabel","taxonomies","select","results","getTaxonomies","per_page","filter","visibility","public","length","slug","name","terms","getEntityRecords","number","children","title","value","options","map","onChange","find","tax","help","checked","placeholder","className","inert","term","registerBlockType","metadata","edit"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"taxonomy/index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACsC;AAM5C;AACa;AAAA;AAE7B,SAASc,IAAIA,CAAE;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAG;EAC7D,MAAM;IAAEC,QAAQ;IAAEC,UAAU;IAAEC,KAAK;IAAEC;EAAU,CAAC,GAAGL,UAAU;EAE7D,MAAMM,UAAU,GAAGd,0DAAS,CACzBe,MAAM,IAAM;IACb,MAAMC,OAAO,GAAG,CACfD,MAAM,CAAE,MAAO,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AC,CACpC,CAAC,EACPgC,KAAK,CAACO,GAAG,CAAIS,IAAI,iBAClBvC,sDAAA;UAAA0B,QAAA,EAA4Ba,IAAI,CAACjB;QAAI,GAAvBiB,IAAI,CAAClB,IAA4B,CAC9C,CAAC;MAAA,CACI,CAAC;IAAA,CACL,CAAC;EAAA,CACL,CAAC;AAEL;;;;;;;;;;;AC5GA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;ACNsD;AAC5B;AACU;AACT;AAE3BmB,oEAAiB,CAAEC,6CAAa,EAAE;EACjC;AACD;AACA;EACCC,IAAI,EAAErC,6CAAIA;AACX,CAAE,CAAC,C","sources":["webpack://query-loop-filter/./src/taxonomy/edit.js","webpack://query-loop-filter/./src/taxonomy/style-index.css?8fc5","webpack://query-loop-filter/external window [\"wp\",\"blockEditor\"]","webpack://query-loop-filter/external window [\"wp\",\"blocks\"]","webpack://query-loop-filter/external window [\"wp\",\"components\"]","webpack://query-loop-filter/external window [\"wp\",\"data\"]","webpack://query-loop-filter/external window [\"wp\",\"i18n\"]","webpack://query-loop-filter/external window \"ReactJSXRuntime\"","webpack://query-loop-filter/webpack/bootstrap","webpack://query-loop-filter/webpack/runtime/compat get default export","webpack://query-loop-filter/webpack/runtime/define property getters","webpack://query-loop-filter/webpack/runtime/hasOwnProperty shorthand","webpack://query-loop-filter/webpack/runtime/make namespace object","webpack://query-loop-filter/./src/taxonomy/index.js"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { useBlockProps, InspectorControls } from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tSelectControl,\n\tTextControl,\n\tToggleControl,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\nexport default function Edit( { attributes, setAttributes } ) {\n\tconst { taxonomy, emptyLabel, label, showLabel } = attributes;\n\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst results = (\n\t\t\t\tselect( 'core' ).getTaxonomies( { per_page: 100 } ) || []\n\t\t\t).filter( ( taxonomy ) => taxonomy.visibility.publicly_queryable );\n\n\t\t\tif ( results && results.length > 0 && ! taxonomy ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ttaxonomy: results[ 0 ].slug,\n\t\t\t\t\tlabel: results[ 0 ].name,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn results;\n\t\t},\n\t\t[ taxonomy ]\n\t);\n\n\tconst terms = useSelect(\n\t\t( select ) => {\n\t\t\treturn (\n\t\t\t\tselect( 'core' ).getEntityRecords( 'taxonomy', taxonomy, {\n\t\t\t\t\tnumber: 50,\n\t\t\t\t} ) || []\n\t\t\t);\n\t\t},\n\t\t[ taxonomy ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t ( {\n\t\t\t\t\t\t\tlabel: taxonomy.name,\n\t\t\t\t\t\t\tvalue: taxonomy.slug,\n\t\t\t\t\t\t} ) ) }\n\t\t\t\t\t\tonChange={ ( taxonomy ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\ttaxonomy,\n\t\t\t\t\t\t\t\tlabel: taxonomies.find(\n\t\t\t\t\t\t\t\t\t( tax ) => tax.slug === taxonomy\n\t\t\t\t\t\t\t\t).name,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t setAttributes( { label } ) }\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { showLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\t\tsetAttributes( { emptyLabel } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t{ showLabel && (\n\t\t\t\t\t\n\t\t\t\t) }\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{ terms.map( ( term ) => (\n\t\t\t\t\t\t\n\t\t\t\t\t) ) }\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"ReactJSXRuntime\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { registerBlockType } from '@wordpress/blocks';\nimport Edit from './edit';\nimport metadata from './block.json';\nimport './style-index.css';\n\nregisterBlockType( metadata.name, {\n\t/**\n\t * @see ./edit.js\n\t */\n\tedit: Edit,\n} );\n"],"names":["__","useBlockProps","InspectorControls","PanelBody","SelectControl","TextControl","ToggleControl","useSelect","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Edit","attributes","setAttributes","taxonomy","emptyLabel","label","showLabel","taxonomies","select","results","getTaxonomies","per_page","filter","visibility","publicly_queryable","length","slug","name","terms","getEntityRecords","number","children","title","value","options","map","onChange","find","tax","help","checked","placeholder","className","inert","term","registerBlockType","metadata","edit"],"sourceRoot":""} \ No newline at end of file diff --git a/build/taxonomy/render.php b/build/taxonomy/render.php index 01d9800..97258b4 100644 --- a/build/taxonomy/render.php +++ b/build/taxonomy/render.php @@ -7,15 +7,15 @@ $taxonomy = get_taxonomy( $attributes['taxonomy'] ); -if ( $block->context['query']['inherit'] ) { - $query_var = sprintf( 'query-%s', $attributes['taxonomy'] ); - $page_var = 'page'; - $base_url = str_replace( '/page/' . get_query_var( 'paged' ), '', remove_query_arg( [ $query_var, $page_var ] ) ); -} else { +if ( empty( $block->context['query']['inherit'] ) ) { $query_id = $block->context['queryId'] ?? 0; $query_var = sprintf( 'query-%d-%s', $query_id, $attributes['taxonomy'] ); $page_var = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; $base_url = remove_query_arg( [ $query_var, $page_var ] ); +} else { + $query_var = sprintf( 'query-%s', $attributes['taxonomy'] ); + $page_var = 'page'; + $base_url = str_replace( '/page/' . get_query_var( 'paged' ), '', remove_query_arg( [ $query_var, $page_var ] ) ); } $terms = get_terms( [ diff --git a/build/taxonomy/view.js.map b/build/taxonomy/view.js.map index 3396a07..a4a503e 100644 --- a/build/taxonomy/view.js.map +++ b/build/taxonomy/view.js.map @@ -1 +1 @@ -{"version":3,"file":"taxonomy/view.js","mappings":";;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;SCAA;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;;;;;;ACN6D;AAE7D,MAAME,SAAS,GAAG,MAAAA,CAAQC,MAAM,EAAEC,KAAK,EAAEC,IAAI,KAAM;EAClD,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAAEJ,MAAO,CAAC;EAC7B,IAAKC,KAAK,IAAIC,IAAI,KAAK,GAAG,EAAG;IAC5BC,GAAG,CAACE,YAAY,CAACC,GAAG,CAAEJ,IAAI,EAAED,KAAM,CAAC;EACpC,CAAC,MAAM;IACNE,GAAG,CAACE,YAAY,CAACE,MAAM,CAAEL,IAAK,CAAC;EAChC;EACA,MAAM;IAAEM;EAAQ,CAAC,GAAG,MAAM,8JAA2C;EACrE,MAAMA,OAAO,CAACC,QAAQ,CAAEN,GAAG,CAACO,QAAQ,CAAC,CAAE,CAAC;AACzC,CAAC;AAED,MAAM;EAAEC;AAAM,CAAC,GAAGd,+DAAK,CAAE,cAAc,EAAE;EACxCW,OAAO,EAAE;IACR,CAACC,QAAQA,CAAEG,CAAC,EAAG;MACdA,CAAC,CAACC,cAAc,CAAC,CAAC;MAClB,MAAM;QAAEL;MAAQ,CAAC,GAAG,MAAM,8JAEzB;MACD,MAAMA,OAAO,CAACC,QAAQ,CAAEG,CAAC,CAACE,MAAM,CAACb,KAAM,CAAC;IACzC,CAAC;IACD,CAACc,MAAMA,CAAEH,CAAC,EAAG;MACZA,CAAC,CAACC,cAAc,CAAC,CAAC;MAClB,MAAM;QAAEG;MAAI,CAAC,GAAGlB,oEAAU,CAAC,CAAC;MAC5B,IAAIE,MAAM,EAAEE,IAAI,EAAED,KAAK;MACvB,IAAKe,GAAG,CAACC,OAAO,KAAK,MAAM,EAAG;QAC7B,MAAMC,KAAK,GAAGF,GAAG,CAACG,aAAa,CAAE,sBAAuB,CAAC;QACzDnB,MAAM,GAAGgB,GAAG,CAAChB,MAAM;QACnBE,IAAI,GAAGgB,KAAK,CAAChB,IAAI;QACjBD,KAAK,GAAGiB,KAAK,CAACjB,KAAK;MACpB,CAAC,MAAM;QACND,MAAM,GAAGgB,GAAG,CAACI,OAAO,CAAE,MAAO,CAAC,CAACpB,MAAM;QACrCE,IAAI,GAAGc,GAAG,CAACd,IAAI;QACfD,KAAK,GAAGe,GAAG,CAACf,KAAK;MAClB;;MAEA;MACA,IAAKA,KAAK,KAAKU,KAAK,CAACU,WAAW,EAAG;MAEnCV,KAAK,CAACU,WAAW,GAAGpB,KAAK;MAEzB,MAAMF,SAAS,CAAEC,MAAM,EAAEC,KAAK,EAAEC,IAAK,CAAC;IACvC;EACD;AACD,CAAE,CAAC,C","sources":["webpack://query-loop-filter/external import \"@wordpress/interactivity-router\"","webpack://query-loop-filter/external module \"@wordpress/interactivity\"","webpack://query-loop-filter/webpack/bootstrap","webpack://query-loop-filter/webpack/runtime/make namespace object","webpack://query-loop-filter/./src/taxonomy/view.js"],"sourcesContent":["module.exports = import(\"@wordpress/interactivity-router\");;","module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { store, getElement } from '@wordpress/interactivity';\n\nconst updateURL = async ( action, value, name ) => {\n\tconst url = new URL( action );\n\tif ( value || name === 's' ) {\n\t\turl.searchParams.set( name, value );\n\t} else {\n\t\turl.searchParams.delete( name );\n\t}\n\tconst { actions } = await import( '@wordpress/interactivity-router' );\n\tawait actions.navigate( url.toString() );\n};\n\nconst { state } = store( 'query-filter', {\n\tactions: {\n\t\t*navigate( e ) {\n\t\t\te.preventDefault();\n\t\t\tconst { actions } = yield import(\n\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t);\n\t\t\tyield actions.navigate( e.target.value );\n\t\t},\n\t\t*search( e ) {\n\t\t\te.preventDefault();\n\t\t\tconst { ref } = getElement();\n\t\t\tlet action, name, value;\n\t\t\tif ( ref.tagName === 'FORM' ) {\n\t\t\t\tconst input = ref.querySelector( 'input[type=\"search\"]' );\n\t\t\t\taction = ref.action;\n\t\t\t\tname = input.name;\n\t\t\t\tvalue = input.value;\n\t\t\t} else {\n\t\t\t\taction = ref.closest( 'form' ).action;\n\t\t\t\tname = ref.name;\n\t\t\t\tvalue = ref.value;\n\t\t\t}\n\n\t\t\t// Don't navigate if the search didn't really change.\n\t\t\tif ( value === state.searchValue ) return;\n\n\t\t\tstate.searchValue = value;\n\n\t\t\tyield updateURL( action, value, name );\n\t\t},\n\t},\n} );\n"],"names":["store","getElement","updateURL","action","value","name","url","URL","searchParams","set","delete","actions","navigate","toString","state","e","preventDefault","target","search","ref","tagName","input","querySelector","closest","searchValue"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"taxonomy/view.js","mappings":";;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;SCAA;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;;;;;;;;ACN6D;AAE7D,MAAME,SAAS,GAAG,MAAAA,CAAQC,MAAM,EAAEC,KAAK,EAAEC,IAAI,KAAM;EAClD,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAAEJ,MAAO,CAAC;EAC7B,IAAKC,KAAK,IAAIC,IAAI,KAAK,GAAG,EAAG;IAC5BC,GAAG,CAACE,YAAY,CAACC,GAAG,CAAEJ,IAAI,EAAED,KAAM,CAAC;EACpC,CAAC,MAAM;IACNE,GAAG,CAACE,YAAY,CAACE,MAAM,CAAEL,IAAK,CAAC;EAChC;EACA,MAAM;IAAEM;EAAQ,CAAC,GAAG,MAAM,8JAA2C;EACrE,MAAMA,OAAO,CAACC,QAAQ,CAAEN,GAAG,CAACO,QAAQ,CAAC,CAAE,CAAC;AACzC,CAAC;AAED,MAAM;EAAEC;AAAM,CAAC,GAAGd,+DAAK,CAAE,cAAc,EAAE;EACxCW,OAAO,EAAE;IACR,CAACC,QAAQA,CAAEG,CAAC,EAAG;MACdA,CAAC,CAACC,cAAc,CAAC,CAAC;MAClB,MAAM;QAAEL;MAAQ,CAAC,GAAG,MAAM,8JAEzB;MACD,MAAMA,OAAO,CAACC,QAAQ,CAAEG,CAAC,CAACE,MAAM,CAACb,KAAM,CAAC;IACzC,CAAC;IACD,CAACc,MAAMA,CAAEH,CAAC,EAAG;MACZA,CAAC,CAACC,cAAc,CAAC,CAAC;MAClB,MAAM;QAAEG;MAAI,CAAC,GAAGlB,oEAAU,CAAC,CAAC;MAC5B,IAAIE,MAAM,EAAEE,IAAI,EAAED,KAAK;MACvB,IAAKe,GAAG,CAACC,OAAO,KAAK,MAAM,EAAG;QAC7B,MAAMC,KAAK,GAAGF,GAAG,CAACG,aAAa,CAAE,sBAAuB,CAAC;QACzDnB,MAAM,GAAGgB,GAAG,CAAChB,MAAM;QACnBE,IAAI,GAAGgB,KAAK,CAAChB,IAAI;QACjBD,KAAK,GAAGiB,KAAK,CAACjB,KAAK;MACpB,CAAC,MAAM;QACND,MAAM,GAAGgB,GAAG,CAACI,OAAO,CAAE,MAAO,CAAC,CAACpB,MAAM;QACrCE,IAAI,GAAGc,GAAG,CAACd,IAAI;QACfD,KAAK,GAAGe,GAAG,CAACf,KAAK;MAClB;;MAEA;MACA,IAAKA,KAAK,KAAKU,KAAK,CAACU,WAAW,EAAG;MAEnCV,KAAK,CAACU,WAAW,GAAGpB,KAAK;MAEzB,MAAMF,SAAS,CAAEC,MAAM,EAAEC,KAAK,EAAEC,IAAK,CAAC;IACvC;EACD;AACD,CAAE,CAAC,C","sources":["webpack://query-loop-filter/external module \"@wordpress/interactivity\"","webpack://query-loop-filter/external import \"@wordpress/interactivity-router\"","webpack://query-loop-filter/webpack/bootstrap","webpack://query-loop-filter/webpack/runtime/make namespace object","webpack://query-loop-filter/./src/taxonomy/view.js"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__;","module.exports = import(\"@wordpress/interactivity-router\");;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { store, getElement } from '@wordpress/interactivity';\n\nconst updateURL = async ( action, value, name ) => {\n\tconst url = new URL( action );\n\tif ( value || name === 's' ) {\n\t\turl.searchParams.set( name, value );\n\t} else {\n\t\turl.searchParams.delete( name );\n\t}\n\tconst { actions } = await import( '@wordpress/interactivity-router' );\n\tawait actions.navigate( url.toString() );\n};\n\nconst { state } = store( 'query-filter', {\n\tactions: {\n\t\t*navigate( e ) {\n\t\t\te.preventDefault();\n\t\t\tconst { actions } = yield import(\n\t\t\t\t'@wordpress/interactivity-router'\n\t\t\t);\n\t\t\tyield actions.navigate( e.target.value );\n\t\t},\n\t\t*search( e ) {\n\t\t\te.preventDefault();\n\t\t\tconst { ref } = getElement();\n\t\t\tlet action, name, value;\n\t\t\tif ( ref.tagName === 'FORM' ) {\n\t\t\t\tconst input = ref.querySelector( 'input[type=\"search\"]' );\n\t\t\t\taction = ref.action;\n\t\t\t\tname = input.name;\n\t\t\t\tvalue = input.value;\n\t\t\t} else {\n\t\t\t\taction = ref.closest( 'form' ).action;\n\t\t\t\tname = ref.name;\n\t\t\t\tvalue = ref.value;\n\t\t\t}\n\n\t\t\t// Don't navigate if the search didn't really change.\n\t\t\tif ( value === state.searchValue ) return;\n\n\t\t\tstate.searchValue = value;\n\n\t\t\tyield updateURL( action, value, name );\n\t\t},\n\t},\n} );\n"],"names":["store","getElement","updateURL","action","value","name","url","URL","searchParams","set","delete","actions","navigate","toString","state","e","preventDefault","target","search","ref","tagName","input","querySelector","closest","searchValue"],"sourceRoot":""} \ No newline at end of file diff --git a/inc/custom-fields-search.php b/inc/custom-fields-search.php new file mode 100644 index 0000000..11ddb0c --- /dev/null +++ b/inc/custom-fields-search.php @@ -0,0 +1,88 @@ +query_vars['s'] ) ) { + return true; + } + + return false; +} + +/** + * Join posts and postmeta tables for custom field search. + * + * @param string $join The JOIN clause of the query. + * @param WP_Query $query The WP_Query instance. + * @return string The modified JOIN clause. + */ +function cf_search_join( $join, $query = null ) { + global $wpdb; + + if ( is_custom_search( $query ) ) { + $join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id '; + } + + return $join; +} + +/** + * Modify the search query with posts_where to include custom fields. + * + * @param string $where The WHERE clause of the query. + * @param WP_Query $query The WP_Query instance. + * @return string The modified WHERE clause. + */ +function cf_search_where( $where, $query = null ) { + global $wpdb; + + if ( is_custom_search( $query ) ) { + $where = preg_replace( + "/\(\s*" . $wpdb->posts . ".post_title\s+LIKE\s*(\'[^\']+\')\s*\)/", + "(" . $wpdb->posts . ".post_title LIKE $1) OR (" . $wpdb->postmeta . ".meta_value LIKE $1)", + $where + ); + } + + return $where; +} + +/** + * Prevent duplicates in search results. + * + * @param string $where The DISTINCT clause of the query. + * @param WP_Query $query The WP_Query instance. + * @return string The modified DISTINCT clause. + */ +function cf_search_distinct( $where, $query = null ) { + if ( is_custom_search( $query ) ) { + return "DISTINCT"; + } + + return $where; +} diff --git a/inc/namespace.php b/inc/namespace.php index 0bd4afa..0e04c98 100644 --- a/inc/namespace.php +++ b/inc/namespace.php @@ -28,6 +28,11 @@ function bootstrap() : void { // Query. add_filter( 'render_block_core/query', __NAMESPACE__ . '\\render_block_query', 10, 3 ); + + // Custom field search. + add_filter( 'posts_join', __NAMESPACE__ . '\\cf_search_join', 10, 2 ); + add_filter( 'posts_where', __NAMESPACE__ . '\\cf_search_where', 10, 2 ); + add_filter( 'posts_distinct', __NAMESPACE__ . '\\cf_search_distinct', 10, 2 ); } /** diff --git a/query-filter.php b/query-filter.php index d6cee33..e5bb571 100644 --- a/query-filter.php +++ b/query-filter.php @@ -4,7 +4,7 @@ * Description: Filter blocks for the query loop utilising the interactivity API. * Requires at least: 6.6 * Requires PHP: 8.0 - * Version: 0.2.1 + * Version: 0.2.2 * Author: Human Made Limited * License: GPL-2.0-or-later * License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -18,5 +18,6 @@ const ROOT_DIR = __DIR__; require_once __DIR__ . '/inc/namespace.php'; +require_once __DIR__ . '/inc/custom-fields-search.php'; bootstrap();