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

Set default post type in class-wp-query.php #6393

Closed

Commits on Apr 15, 2024

  1. 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.
    jonnynews committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    2a25375 View commit details
    Browse the repository at this point in the history
  2. 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.
    jonnynews committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    68beadd View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. 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.
    jonnynews committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    f2cd2ac View commit details
    Browse the repository at this point in the history
  2. Fix lints.

    jonnynews committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    43b0bbf View commit details
    Browse the repository at this point in the history
  3. 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.
    jonnynews committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    b16e823 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2024

  1. Fix lint error

    jonnynews committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    694b385 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. 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.
    jonnynews committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    533509b View commit details
    Browse the repository at this point in the history
  2. 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.
    jonnynews committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    934496d View commit details
    Browse the repository at this point in the history
  3. Apply suggestions from code review

    Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
    jonnynews and mukeshpanchal27 committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    fa3a5af View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2024

  1. Apply suggestions from code review

    Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
    spacedmonkey and mukeshpanchal27 committed Apr 23, 2024
    Configuration menu
    Copy the full SHA
    4c95d7e View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Configuration menu
    Copy the full SHA
    900df75 View commit details
    Browse the repository at this point in the history
  2. 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.
    spacedmonkey committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    55026bc View commit details
    Browse the repository at this point in the history

Commits on May 1, 2024

  1. 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.
    spacedmonkey committed May 1, 2024
    Configuration menu
    Copy the full SHA
    354472d View commit details
    Browse the repository at this point in the history

Commits on May 3, 2024

  1. Apply suggestions from code review

    Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
    jonnynews and peterwilsoncc committed May 3, 2024
    Configuration menu
    Copy the full SHA
    8d848b0 View commit details
    Browse the repository at this point in the history

Commits on May 4, 2024

  1. Configuration menu
    Copy the full SHA
    0b8aa8f View commit details
    Browse the repository at this point in the history
  2. Fix lint errors.

    spacedmonkey committed May 4, 2024
    Configuration menu
    Copy the full SHA
    1fefe3e View commit details
    Browse the repository at this point in the history

Commits on May 8, 2024

  1. Configuration menu
    Copy the full SHA
    37da92c View commit details
    Browse the repository at this point in the history