-
Notifications
You must be signed in to change notification settings - Fork 0
Add test code #1
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: trunk
Are you sure you want to change the base?
Changes from all commits
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 | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -156,3 +156,53 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| endif; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| function test_codrabbit() { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| $a = 10; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $b = 20 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $c = $a + $b | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo $c; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| function get_letest_article() { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| $args = array( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'post_type' = 'post', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| $the_query = new WP_Query( $args ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return $the_query; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| function ie_get_custom_post() { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||||||
| + * Retrieves the custom post. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| + * | ||||||||||||||||||||||||||||||||||||||||||||||||||
| + * @since Twenty Twenty-Five 1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| + * | ||||||||||||||||||||||||||||||||||||||||||||||||||
| + * @return WP_Query|false Query object on success, false on failure. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| + */ | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| $args = array( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'post_type' => 'post', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'post_per_page' => '2000', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 'post__not_in' => array('2', '5', '100') | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Check failure on line 189 in src/wp-content/themes/twentytwentyfive/functions.php
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if($the_query->have_posts()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| + return $the_query; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| + } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return false; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| function ie_display_dynamic_message( $title ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * Display message. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * @since Twenty Twenty-Five 1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| if(!empty($title)){ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| printf( '<h1>%s</h1>', sesc_html( $title ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+197
to
+208
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. Fix function name typo and remove test code from production theme. This function has several issues:
Apply this diff to fix the function name: - printf( '<h1>%s</h1>', sesc_html( $title ) );
+ printf( '<h1>%s</h1>', esc_html( $title ) );However, this entire function should be removed from the production theme file as it's test code. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Actions: Coding Standards[error] 164-208: PHP CodeSniffer found 34 errors affecting 14 lines including multiple whitespace, indentation, and formatting issues such as disallowed tabs, missing spaces, incorrect control structure spacing, missing newline at end of file, and superfluous whitespace. Run PHPCBF to fix 33 of these automatically. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.