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

Sticky posts are ignored #2971

Closed
2 of 3 tasks
PSMJonas opened this issue Oct 15, 2023 · 3 comments
Closed
2 of 3 tasks

Sticky posts are ignored #2971

PSMJonas opened this issue Oct 15, 2023 · 3 comments
Labels
Duplicate This issue or pull request already exists Status: Discussion Requires a discussion to proceed Type: Enhancement New feature or request

Comments

@PSMJonas
Copy link

Description

When I mark a post as sticky, it is not output first in the query.

I read in another issue that by default $query_args['ignore_sticky_posts'] is set to true.

https://github.com/wp-graphql/wp-graphql/blob/develop/src/Data/Connection/PostObjectConnectionResolver.php#L178

I have disabled this:

add_filter('graphql_post_object_connection_query_args', function($query_args, $source, $input) {
    $query_args['ignore_sticky_posts'] = false;
    return $query_args;
}, 10, 3);

Unfortunately this did not change anything.

Steps to reproduce

  1. mark a post as sticky.
  2. Output a query with posts.
  3. The sticky post is not output at the top.

Additional context

No response

WPGraphQL Version

0.12.2

WordPress Version

6.3.2

PHP Version

8.1

Additional environment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
@jasonbahl
Copy link
Collaborator

related #863
related #786

@PSMJonas
Copy link
Author

I saw that, but there doesn't seem to be a solution currently.

@jasonbahl jasonbahl added Type: Enhancement New feature or request Status: Discussion Requires a discussion to proceed labels Oct 16, 2023
@justlevine
Copy link
Collaborator

Confirming this as a duplicate of #786 and closing.

@PSMJonas while the PR above is out of date, the cause and proposed solve in the issue are still relevant. If you have any feedback on what's been proposed in #786, please feel free to share it as a comment over there 😎

@justlevine justlevine closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2023
@justlevine justlevine added the Duplicate This issue or pull request already exists label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate This issue or pull request already exists Status: Discussion Requires a discussion to proceed Type: Enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

3 participants