feat/support multiple connections#125
Conversation
|
Coverage report for commit: bf1609f Summary - Lines: 30.12% | Methods: 58.49%
🤖 comment via lucassabreu/comment-coverage-clover |
||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
Adds support for filtering query results by multiple configured “connections” between post types (issue #119), extending the existing single-connection implementation.
Changes:
- Update connection meta-key resolution to return multiple
meta_keyvalues per target post type. - Adjust the query-layer connection filter to use
whereHas('meta', ...)withwhereInconstraints. - Tighten
enableConnection()to requireconnectionPoststo be non-empty.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/Query/PostQuery.php | Reworks the connection filter from hasMeta(...) to a meta relationship subquery for multi-connection support. |
| src/Block/BlockAttributes.php | Changes connection meta-key lookup to return multiple keys and alters how selected connection targets are represented. |
Comments suppressed due to low confidence (1)
src/Block/BlockAttributes.php:88
- The phpdoc for
connectedPost()no longer matches what the method returns. It currently builds an array withmeta_keys(array) andpost_id(list), but the doc saysarray<string, int>and has an extra}. Updating the docblock (and ideally the return shape/type) will help static analysis and prevent misuse by callers.
/**
* @return array<string, int>}
*/
public function connectedPost(): array
{
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
df9039d to
87c2544
Compare
|
@SimonvanWijhe I've opened a new pull request, #127, to work on those changes. Once the pull request is ready, I'll request review from you. |
… multiple connections scenarios Co-authored-by: SimonvanWijhe <41121933+SimonvanWijhe@users.noreply.github.com>
4cc1640 to
cf21177
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| handleChange={ onChange } | ||
| isClearable={ true } | ||
| isMulti={ false } | ||
| isMulti={ true } |
There was a problem hiding this comment.
Deze moet nu toch weer op false? Want dat werkt toch niet?
| /** | ||
| * Decodes HTML entities commonly found in post-titles and names | ||
| * | ||
| * @param {string} text - The text to decode | ||
| * @return {string} Decoded text | ||
| */ | ||
| export const decodeEntities = ( text = '' ) => { |
There was a problem hiding this comment.
Er is hier een wordpress package voor https://developer.wordpress.org/block-editor/reference-guides/packages/packages-html-entities/
Je hoeft hem volgens mij niet te installen, staat op de wp global, dus on top of the file
import { decodeEntities } from '@wordpress/html-entities';
doen

Fixes #119
TODO:
getest in participatie met config:
Screen.Recording.2026-03-10.at.15.28.59.mov