pubsubhubbub / wordpress-pubsubhubbub

WebSub/PubSubHubbub for WordPress
https://wordpress.org/plugins/pubsubhubbub/
MIT License
64 stars 11 forks source link

Support for custom post types #16

Closed realrellek closed 2 years ago

realrellek commented 3 years ago

Hi,

I have a website and we use different custom post types. However, I saw that while on the regular feed the hub announcement is available, it is not on CPT's feeds.

Could we fix that somehow?

Thanks!

realrellek commented 3 years ago

Update.

I mean I can add this line to my CPT declarations: if(is_callable(array('PubSubHubbub_Publisher', 'publish_post'))) add_action('publish_news', array('PubSubHubbub_Publisher', 'publish_post'));

Because publishpost only applies to posts, not to custom post types. They have their own actions, publish{post_type}

But it still does not show up in example.com/news/feed/

I think this is because the if() in pubsubhubhub_show_discovery https://github.com/pubsubhubbub/wordpress-pubsubhubbub/blob/c1b29764c7a393fc589bc7cf1efc64fce85892ca/includes/functions.php#L26 returns false.

if_post_type_archive() returns true is_singular() returns false (of course it does on a landing page) is_home() is false because it's not home

Can anyone think of a simple fix for that?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

pfefferle commented 2 years ago

keep