Skip to content
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

Add helper functions for retrieving post relationships #96

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

s3rgiosan
Copy link
Member

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:

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