-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Set default post type in class-wp-query.php #6393
Commits on Apr 15, 2024
-
Set default post type in class-wp-query.php
Post type handling in the WP_Query class has been improved. Now, if a post type is not defined, a default one will be set based on whether the post is an attachment, a page, or a regular post. This adjustment streamlines the code, improving both efficiency and readability.
Configuration menu - View commit details
-
Copy full SHA for 2a25375 - Browse repository at this point
Copy the full SHA 2a25375View commit details -
Normalize post type handling in WP_Query and update tests
The post type handling in WP_Query has been refined to automatically set a default value when no specific post type is given. This change simplifies the defined arguments and enhances the code's efficiency. Additionally, test cases have been expanded to confirm the correct cache key generation related to the implemented changes.
Configuration menu - View commit details
-
Copy full SHA for 68beadd - Browse repository at this point
Copy the full SHA 68beaddView commit details
Commits on Apr 16, 2024
-
Update SQL query formatting and refactor cache key test
Corrected the indentation in SQL query to improve code readability. The "test_generate_cache_key_normalize" method has been refactored to handle the fields and request variables accurately, ensuring proper testing of cache key generation across different queries and post types.
Configuration menu - View commit details
-
Copy full SHA for f2cd2ac - Browse repository at this point
Copy the full SHA f2cd2acView commit details -
Configuration menu - View commit details
-
Copy full SHA for 43b0bbf - Browse repository at this point
Copy the full SHA 43b0bbfView commit details -
Sort post types for cache key generation
The code has been updated to sort post types before the cache key generation to ensure consistency. Also, a default orderby value of 'date' has been added for the same purpose. Changes have been tested by adding a new test case to verify the query cache for differently ordered post types.
Configuration menu - View commit details
-
Copy full SHA for b16e823 - Browse repository at this point
Copy the full SHA b16e823View commit details
Commits on Apr 17, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 694b385 - Browse repository at this point
Copy the full SHA 694b385View commit details
Commits on Apr 22, 2024
-
Update 'any' post type in WP_Query
The WP_Query has been updated to correctly handle 'any' as a valid post type argument. This includes a change where 'any' will now return all post types excluded from search. New tests have also been introduced to ensure cache keys behave as expected when post types are registered, unregistered, and clarified under 'any' classification.
Configuration menu - View commit details
-
Copy full SHA for 533509b - Browse repository at this point
Copy the full SHA 533509bView commit details -
Add new test case to cacheResults.php
A new test scenario 'any and post types' has been added to the `cacheResults.php` testing module. This change aims to improve test coverage by checking query variables against different types of posts such as 'post', 'page', 'attachment' under the 'any' post type.
Configuration menu - View commit details
-
Copy full SHA for 934496d - Browse repository at this point
Copy the full SHA 934496dView commit details -
Apply suggestions from code review
Co-authored-by: Mukesh Panchal <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fa3a5af - Browse repository at this point
Copy the full SHA fa3a5afView commit details
Commits on Apr 23, 2024
-
Apply suggestions from code review
Co-authored-by: Mukesh Panchal <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4c95d7e - Browse repository at this point
Copy the full SHA 4c95d7eView commit details
Commits on Apr 30, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 900df75 - Browse repository at this point
Copy the full SHA 900df75View commit details -
Sort post types for consistent cache key generation
An update was made to the WP_Query class to ensure that when multiple post types are in use, they are sorted to generate a consistent cache key. This helps avoid potential issues with cache key mismatch and optimizes the performance of WordPress' cache system.
Configuration menu - View commit details
-
Copy full SHA for 55026bc - Browse repository at this point
Copy the full SHA 55026bcView commit details
Commits on May 1, 2024
-
Sort queried post types and status for consistent cache key generation
In the class-wp-query.php file, the queried post types are now sorted to ensure consistency in cache key generation. Similarly, post statuses are also sorted for the same reason. This change also impacted the related unit tests in cacheResults.php, which are updated to reflect this new sorting logic.
Configuration menu - View commit details
-
Copy full SHA for 354472d - Browse repository at this point
Copy the full SHA 354472dView commit details
Commits on May 3, 2024
-
Apply suggestions from code review
Co-authored-by: Peter Wilson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8d848b0 - Browse repository at this point
Copy the full SHA 8d848b0View commit details
Commits on May 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0b8aa8f - Browse repository at this point
Copy the full SHA 0b8aa8fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1fefe3e - Browse repository at this point
Copy the full SHA 1fefe3eView commit details
Commits on May 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 37da92c - Browse repository at this point
Copy the full SHA 37da92cView commit details