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

distributable_post_types filter is not respected in Pull UI screen #720

Closed
jmslbam opened this issue Feb 13, 2021 · 5 comments · Fixed by #904
Closed

distributable_post_types filter is not respected in Pull UI screen #720

jmslbam opened this issue Feb 13, 2021 · 5 comments · Fixed by #904
Assignees
Labels
help wanted needs:documentation This requires documentation. type:enhancement New feature or request. type:good-first-issue Good for newcomers.
Milestone

Comments

@jmslbam
Copy link

jmslbam commented Feb 13, 2021

Describe the bug
while filtering the permited post types via distributable_post_types, I noticed that the dropdown in de Pull UI has all the post types in the dropdown.

Steps to Reproduce
Filter the permited post types:

add_filter( 'distributable_post_types', function() {
    return [ 'post' => 'post' ];
});

Go to the Pull overview page en check the dropdown.

Expected behavior
I expected only the Post post type in the dropdown.

Environment information

  • WordPress version: 5.6.1

Version | 1.6.2

Override Author Byline: Yes

Media Handling: Featured image and attached images

Internal Connections |
Maas Wijkontwikkeling: - Blog ID: 2 - URL: https://waal.local/maasontwikkel - Registered: 2021-02-01 13:52:41 - Last updated: 2021-02-13 17:09:18
Woonslim: - Blog ID: 3 - URL: https://waal.local/woonslim - Registered: 2021-02-01 13:52:56 - Last updated: 2021-02-03 08:33:12

External Connections | N/A

Additional context
Thank you!

@jmslbam jmslbam added the type:bug Something isn't working. label Feb 13, 2021
@dkotter
Copy link
Collaborator

dkotter commented Feb 15, 2021

@jmslbam There is actually a different filter in place to modify the post types available for pulling: dt_available_pull_post_types: https://github.com/10up/distributor/blob/develop/includes/utils.php#L257

I can understand the confusion between that filter and distributable_post_types. One is used when pushing content, the other is for pulling content.

@dkotter dkotter self-assigned this Feb 15, 2021
@jeffpaul jeffpaul added needs:documentation This requires documentation. and removed type:bug Something isn't working. labels Feb 16, 2021
@jeffpaul jeffpaul added this to the 1.6.3 milestone Feb 16, 2021
@jeffpaul
Copy link
Member

Labeling this for docs so we can add more clarity to the docblock on distributable_post_types and hopefully make the push vs. pull scenario a bit clearer.

@jmslbam
Copy link
Author

jmslbam commented Feb 16, 2021

Ah thank your for pointing the other filter out!

I feel like distributable_post_types (or a new dt_distributable_post_types) can be the generic overal filter and new dt_distributable_pull_post_types and a new dt_distributable_push_post_types can be the filter for each scenario.

This makes the filter consistent in their naming convention and logic. Not having the word "push" or "pull" in it, makes it look like a generic filter that goes both ways.

We can deprecate the old filters with do_action_deprecated or apply_filters_deprecated in WP.

If this new nameing convention feels ok, I can patch up a PR somewhere this month.

@dkotter
Copy link
Collaborator

dkotter commented Feb 19, 2021

@jmslbam I think this all sounds correct and the right approach to me. If you have time to put together a PR, I'd be happy to review it. Thanks!

@jeffpaul jeffpaul modified the milestones: 1.6.3, 1.7.0 Mar 10, 2021
@jmslbam
Copy link
Author

jmslbam commented Apr 20, 2021

I'm stil up for this, but the Distributor project I'm working on has some little hickups :) when it's live I have some spare time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted needs:documentation This requires documentation. type:enhancement New feature or request. type:good-first-issue Good for newcomers.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants