Skip to content

Conversation

@s3rgiosan
Copy link
Member

@s3rgiosan s3rgiosan commented Feb 7, 2025

Description of the Change

This PR introduces three new helper functions to improve Block Editor integration by providing a more modular way to access relationship data.

  • get_post_to_post_relationships_by and get_post_to_user_relationships_by allow developers to retrieve post-to-post and post-to-user relationships based on a specific field, such as key, post type, or from/to post types in post-to-post relationships.
  • get_post_relationship_data exposes the same data used in the Vue app without requiring the tenup_content_connect_post_relationship_data filters.

Closes #82

Changelog Entry

Added - Helper function get_post_to_post_relationships_by that retrieves post-to-post relationships based on a specified field.
Added - Helper function get_post_to_user_relationships_by that retrieves post-to-user relationships based on a specified field.
Added - Helper function get_post_relationship_data that retrieves relationships (post-to-post and post-to-user) for a given post (#82).
Added - Helper function get_post_to_post_relationships_data that retrieves post-to-post relationship data for a given post.
Added - Helper function get_post_to_user_relationships_data that retrieves post-to-user relationship data for a given post.

Credits

Props @s3rgiosan

Checklist:

@s3rgiosan s3rgiosan added this to the 1.7.0 milestone Feb 7, 2025
@s3rgiosan s3rgiosan requested a review from jeffpaul February 7, 2025 17:50
@s3rgiosan s3rgiosan requested a review from rickalee as a code owner February 7, 2025 17:50
@s3rgiosan s3rgiosan changed the title Update documentation and add some extra checks Add helper functions for retrieving post relationships Feb 7, 2025
@s3rgiosan s3rgiosan changed the base branch from master to develop February 17, 2025 10:56
@s3rgiosan
Copy link
Member Author

Closed in favor of #96

@s3rgiosan s3rgiosan closed this Feb 18, 2025
@s3rgiosan s3rgiosan deleted the feature/helpers branch February 18, 2025 10:23
@jeffpaul jeffpaul removed this from the 1.7.0 milestone Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new API's to make it easier to get all the relationships for a given post type

2 participants