Ignores post types with 'public' => fase, 'has_archive' => true #13

Closed
mrwweb opened this Issue Jun 17, 2013 · 6 comments

Comments

Projects
None yet
2 participants
@mrwweb

mrwweb commented Jun 17, 2013

I see that the plugin queries public not-built-in post types. However, in my current project, I'm using a private post type that will have an archive. (I don't think it's too hard to think of relevant use-cases for this: Anything where individual posts don't warrant a webpage but listing them all together does. Using 'public' => false prevents the "View Post" links which is my primary motivation for setting that.)

I see a lot of possible solutions but I'm not sure which is best:

  1. Query for 'has_archive' => true. Since the default is false, this might be sufficient.
  2. Allow a developer to filter the $post_types the plugin uses.
  3. Allow a developer to filter the get_post_type()

I would lean toward option 3 (and maybe pass the $args as a parameter so both 2 and 3 are possible with that filter) but I'd love to hear other thoughts. It seems like a straight-forward way to make the plugin more flexible without changing too much for the out-of-the-box users.

@mrwweb

This comment has been minimized.

Show comment Hide comment
@mrwweb

mrwweb Jun 17, 2013

Ok. Looks like I spoke a little too soon. WordPress can't make a post type archive with public => false. So my use case isn't workable and I need to find another way to handle it.

However, I'll leave this open as I still think it might be worthwhile to let the $post_types get filtered.

mrwweb commented Jun 17, 2013

Ok. Looks like I spoke a little too soon. WordPress can't make a post type archive with public => false. So my use case isn't workable and I need to find another way to handle it.

However, I'll leave this open as I still think it might be worthwhile to let the $post_types get filtered.

@stephenharris

This comment has been minimized.

Show comment Hide comment
@stephenharris

stephenharris Jun 25, 2013

Owner

Hey @mrwweb - yup only 'public' post types can have archive. Agree on filtering the post types - will add this...

Owner

stephenharris commented Jun 25, 2013

Hey @mrwweb - yup only 'public' post types can have archive. Agree on filtering the post types - will add this...

@mrwweb

This comment has been minimized.

Show comment Hide comment
@mrwweb

mrwweb Jun 26, 2013

Sounds good. Since the default for has_archive is false, does it make sense to only show public non-built-in post types with 'has_archive' => true?

mrwweb commented Jun 26, 2013

Sounds good. Since the default for has_archive is false, does it make sense to only show public non-built-in post types with 'has_archive' => true?

@stephenharris

This comment has been minimized.

Show comment Hide comment
@stephenharris

stephenharris Jun 26, 2013

Owner

Are you suggesting changing the query to 'has_archive'=>true instead of 'public'=>true (in case a public post type doesn't have an archive)?

Owner

stephenharris commented Jun 26, 2013

Are you suggesting changing the query to 'has_archive'=>true instead of 'public'=>true (in case a public post type doesn't have an archive)?

@mrwweb

This comment has been minimized.

Show comment Hide comment
@mrwweb

mrwweb Jun 26, 2013

That's the thought. I think the has_archive must be true for the plugin to
be useful for a post type. But I might be overlooking something.

On Tue, Jun 25, 2013 at 5:17 PM, Stephen Harris notifications@github.comwrote:

Are you suggesting changing the query to 'has_archive'=>true instead of
'public'=>true (in case a public post type doesn't have an archive)?


Reply to this email directly or view it on GitHubhttps://github.com/stephenharris/WordPress-Post-Type-Archive-Links/issues/13#issuecomment-20018560
.

mrwweb commented Jun 26, 2013

That's the thought. I think the has_archive must be true for the plugin to
be useful for a post type. But I might be overlooking something.

On Tue, Jun 25, 2013 at 5:17 PM, Stephen Harris notifications@github.comwrote:

Are you suggesting changing the query to 'has_archive'=>true instead of
'public'=>true (in case a public post type doesn't have an archive)?


Reply to this email directly or view it on GitHubhttps://github.com/stephenharris/WordPress-Post-Type-Archive-Links/issues/13#issuecomment-20018560
.

@stephenharris

This comment has been minimized.

Show comment Hide comment
@stephenharris

stephenharris Nov 15, 2013

Owner

Fixed with 1.2. Thanks!

Owner

stephenharris commented Nov 15, 2013

Fixed with 1.2. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment