-
Notifications
You must be signed in to change notification settings - Fork 19
Add initial support for handling of virtual posts #1171
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
Changes from 3 commits
54eb791
d9439d5
99cbbde
c45b2f5
6e5703f
d983812
271affd
df67427
ab13da2
6142569
069d9e4
0873d1e
e345aed
6e5e3ed
f2bd12e
bc4bc75
0c5ff01
e4310ca
fd255b7
15e4287
0942007
8b7c400
1479e49
b42c504
cc29ba6
b926db8
f2c626e
7b2fe61
3da0f7a
6cd7e6c
7cf16c9
2841157
1fe997b
6b7f7d1
fe5688c
bc5c1ce
89d8213
b255202
ec9da2c
1a6228f
04d33f6
aa56926
93be94e
ab9bdb2
c150739
90aa188
96a5305
0e4b108
7622b19
953d1e9
800271c
c59d654
f4bf0b2
9d1d6af
23e8fe6
8a4c686
819c1c1
d99c4ca
0a3b14b
f5b5fea
a61432c
0ab9548
57cce49
4fc1925
e2dca0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,7 +31,7 @@ public function init_hooks(): void { | |||||||||||
| * @return void | ||||||||||||
| */ | ||||||||||||
| public function register_meta_boxes(): void { | ||||||||||||
| $post_types = get_option( 'edac_post_types' ); | ||||||||||||
| $post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) ); | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainFilter name doesn't follow coding guidelines. The filter name uses Apply this diff to use the correct prefix: - $post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );
+ $post_types = apply_filters( 'edac_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );Please verify that this filter name change is applied consistently across the codebase: 🏁 Script executed: #!/bin/bash
# Description: Check for consistent usage of the filter name across the codebase
# Expected: All occurrences should use the same filter name
echo "Searching for the current filter name with edacp_ prefix:"
rg "edacp_fill_site_scan_scannable_post_types" -A 2 -B 2
echo -e "\nSearching for similar filter names with edac_ prefix:"
rg "edac_fill_site_scan_scannable_post_types" -A 2 -B 2
echo -e "\nSearching for all edacp_ prefixed filters:"
rg "edacp_" -A 1 -B 1Length of output: 4640 Filter hook prefix should use Coding guidelines require a • includes/classes/class-rest-api.php Proposed diffs: diff --git a/includes/classes/class-rest-api.php b/includes/classes/class-rest-api.php
--- a/includes/classes/class-rest-api.php
+++ b/includes/classes/class-rest-api.php
- $post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );
+ $post_types = apply_filters( 'edac_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );diff --git a/admin/class-meta-boxes.php b/admin/class-meta-boxes.php
--- a/admin/class-meta-boxes.php
+++ b/admin/class-meta-boxes.php
- $post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );
+ $post_types = apply_filters( 'edac_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );Also, search the codebase for any remaining 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| if ( $post_types ) { | ||||||||||||
| foreach ( $post_types as $post_type ) { | ||||||||||||
| add_meta_box( | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -297,7 +297,7 @@ public function set_post_scan_results( $request ) { | |||||
| } | ||||||
|
|
||||||
| $post_type = get_post_type( $post ); | ||||||
| $post_types = Helpers::get_option_as_array( 'edac_post_types' ); | ||||||
| $post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) ); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The filter name $post_types = apply_filters( 'edacp_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use The filter name Apply this diff to use the correct prefix: - $post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );
+ $post_types = apply_filters( 'edac_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| if ( empty( $post_types ) || ! in_array( $post_type, $post_types, true ) ) { | ||||||
|
|
||||||
| return new \WP_REST_Response( [ 'message' => 'The post type is not set to be scanned.' ], 400 ); | ||||||
|
|
||||||
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.
🛠️ Refactor suggestion
Add PHPDoc documentation for the new filter hook.
The filter hook implementation is correct and follows the
edac_prefix convention, but it lacks proper documentation. According to the coding guidelines, all custom hooks should be documented with clear descriptions and parameter types.Add PHPDoc documentation above the filter:
📝 Committable suggestion
🤖 Prompt for AI Agents