-
Notifications
You must be signed in to change notification settings - Fork 22
Feature: Native Block Editor Interface #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/rest-api-endpoint
Are you sure you want to change the base?
Conversation
4608980 to
621e135
Compare
… Classic Editor usage
|
Hi @fabiankaegy I went ahead and updated the UI to use the new ContentPicker, along with some fixes and improvements for post-to-user relationship support and bi-directional panels in post-to-post relationships. Ready for your review when you can. |
|
@fabiankaegy latest update on the sorting experience: Screen.Recording.2025-05-06.at.6.42.59.PM.mp4 |
I just tested the latest changes and the problem doesn't exist anymore. Good job! Something to consider: The content picker doesn't work well with longer titles. The component uses |
Thanks for the suggestion, @ocean90! I'm actually working on a custom picker item for Content Connect here: #99. I'll keep that in mind when I get back to it. |
| queryFilter={(query) => { | ||
| if (relationship?.rel_key) { | ||
| return addQueryArgs(query, { | ||
| content_connect: relationship.rel_key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this search parameter mainly to give context to the editor-side search when it reaches the rest_post_search_query hook in PHP. One of my clients uses ElasticPress, and I needed a way to disable EP for these specific queries. This parameter can also be used to filter search results based on client-specific requirements. It might also be worth including the current post ID.
Remove commented code
The JS that renders the content picker already added support for a new max_items key on the relationship args. This update adds the required PHP update to support that key.
Feature/max items
# Conflicts: # includes/API/V2/Route/Relationships.php
|
Noticed an issue with the display of relationships which can't be edited by the user: 10up/block-components#390 |
Warning
This PR is based on top of #91
Description of the Change
Adds a WordPress Data store to more easily interface with the Content Connect REST API from within the Block Editor.
Closes #45
How to test the Change
wp.data.select('wp-content-connect').getRelationships(xxx)where xxx is the current post iduseSelectwill smooth this experience)wp.data.select('wp-content-connect').getRelatedPosts(xxx, 'university_city_university_to_city')wp.data.dispatch('wp-content-connect').updateRelatedPosts( xxx, 'university_city_university_to_city', [ yyy, zzz ] )Note
This PR is still very much in progress and subject to change :)
Changelog Entry
Credits
Props @fabiankaegy @s3rgiosan