-
Notifications
You must be signed in to change notification settings - Fork 32
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
PCH: Initialize Content Helper features on 'rest_api_init' #2606
Conversation
WalkthroughThe new change introduces a Changes
Sequence Diagram(s)sequenceDiagram
participant W as WordPress
participant P as wp-parsely.php
participant F as parsely_content_helper_editor_sidebar_features
W->>P: Initialize REST API
P->>W: Add rest_api_init Hook
W->>P: Execute rest_api_init Hook
P->>F: Invoke parsely_content_helper_editor_sidebar_features
F->>P: Functionality executed
P->>W: REST API ready with extra features
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- wp-parsely.php (1 hunks)
Additional context used
Path-based instructions (1)
wp-parsely.php (1)
Pattern
**/*.{html,php}
: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the HTML and PHP code to ensure it is well-structured and adheres to best practices.
- Ensure the code follows WordPress coding standards and is well-documented.
- Confirm the code is secure and free from vulnerabilities.
- Optimize the code for performance, removing any unnecessary elements.
- Validate comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Verify code compatibility with the latest version of WordPress, avoiding deprecated functions or features."
Additional comments not posted (2)
wp-parsely.php (2)
290-290
: Approve the addition of therest_api_init
action hook.The addition ensures that the Content Helper features are initialized during the REST API initialization, which is necessary for making the custom post type and taxonomies available in the REST API context.
291-291
: Approve the addition of the blank line for readability.The blank line improves readability by separating the action hook from the subsequent comment block and function definition.
Thanks for fixing this. Since we're now calling it in |
@acicovic yeah, I believe so, so that the initialization also happens on wp-admin and not only just on the REST API. |
rest_api_init
Description
This PR is a follow up of #2578. The Content Helper features also need to be initialized on
rest_api_init
, otherwise the custom post type and taxonomies for the Smart Linking feature will not be available in the REST API context.Motivation and context
Fixes a bug where the Smart Linking
/get
endpoint does not return any smart links because thesmart_link_source
taxonomy does not exists.How has this been tested?
Tested locally, and validated that the Smart Linking endpoint returns the expected results.
Summary by CodeRabbit
rest_api_init
action, improving content management capabilities in the editor sidebar.