-
Notifications
You must be signed in to change notification settings - Fork 157
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
CPT Support #510
Comments
@pstamandjr I'm assuming your sites in question are different WordPress instances and not within the same multisite (as you do not need to create External Connections for sites within the same multisite). In this case, if you set the second URL you noted as the |
@jeffpaul Yes, you are correct. They are two separate WordPress instances. In the external connection screen I can't pass in the URL of the direct CPT. (See screenshot below) I can hit the main /wp-json/ which validates, however when trying to pass in a direct feed (ie: "/wp-json/wp/v2/podcast?series=385" it won't validate the URL. Thanks for help. |
@pstamandjr you don't need to pass in the specific CPT URL, just the main |
Ah, ok. That makes sense. I thought you could just connect directly to a specified feed, but I'm seeing them now and can customize to pair down what gets pulled in. Thanks again! |
Hey @jeffpaul, do you have any documented examples of just pulling specific Custom Post type categories? Right now the /wp-json/ pulls all posts, including the custom post type we have setup for "podcasts", however there isn't a filter to narrow down to 1 specific category. Basically, we need to pull specific CPT categories from. (ie: /wp-json/wp/v2/podcast?series=385) Any help would be greatly appreciated! |
@jeffpaul - Follow up to see if you could help with this. :) |
@pstamandjr I'll check on that and get back to you |
@jeffpaul Just checking in to see if you were able to check in on this. Thank you! |
@pstamandjr there's currently no way to filter to specific categories of a CPT. It sounds like #428 may be the functionality you're looking for, correct? |
@jeffpaul Yes, that is what we are looking to do, more or less. Rather than allowing the categories in the dropdown list to filter, can we hide them all together? So, we only pull in posts for this one specific category. Basically, the 2nd site we are pushing to, should only have access to these specific posts and not be able to pull in others. Does that make sense? |
@pstamandjr makes sense, probably best to note on #428 so we can include a hook to support that use case when someone gets to working on 428 (and we can then close this issue in favor of that one). |
@jeffpaul That would be great! Do you know when it's slated for? Any change I can beg, borrow, or steal to have it done sooner. Hahha :) |
@pstamandjr the 428 issue is currently unscheduled, but sitting on our roadmap a couple releases out so its unlikely to be available in the very near future. We do offer paid customization, implementation, and support packages should that be desired; if you're interested in that send me an email ([email protected]) and we can discuss available options. |
@pstamandjr after chatting with our team, there is a filter around the post types that show in that pull list: https://10up.github.io/distributor/dt_available_pull_post_types.html. If you only want a specific post type to show, you can do that using that filter. You can also pass a query param to the pull page, if you want to filter that way. So a URL like Let me know if that doesn't cover the CPT question from this issue, otherwise we can close out this question. |
@jeffpaul thank you again for the reply. We would definitely be leaning towards the first option of filtering out the post types that pull. I'm trying to target that filter by the example here: #274 but it doesn't unfortunately filter it out. Would this still be current with the latest version?
|
@pstamandjr That filter is in place in the current version (was added in 1.3.5). Looking at that example, the filter is using 5 arguments but in your I just tested this on my setup to only show Pages in the filter dropdown (by default it was showing Post and Pages), and it worked:
|
After discussing with @pstamandjr via email, his issue has been resolved so I'm closing this issue but happy to re-open for others with a similar need. Thanks! |
I posted on #103, however it's a closed issue, so wanted to create a new one.
I'm running into the same issue, when trying to use a different endpoint than /wp-json/. I need to pull specific posts from a CPT.
Example I'm trying to use: https://WWW.URL.COM/wp-json/wp/v2/podcast?series=123
I've registered the CPT and set: "show_in_rest" => true
I keep getting this error:
However if I just use "https://WWW.URL.COM/wp-json/" for the endpoint it connects fine.
Any help would be appreciated!
The text was updated successfully, but these errors were encountered: