Dear Sir/Madam,
I have a plugin "WP-Invoice", I search it from the database and find the post_type is "wpi_object", at what reason I can't find this post type from View?
How I can query it via View if I already know the post_type?
Best regards,
Kelvin.
If the post type is not publicly queryable or somehow hidden, which I strongly suspect given this is a probably private, not public invoice, then you cannot query it in Toolset Views.
If the Post Type is public and queriable then it's also visible in Toolset Views.
Dear Beda,
As PHP is open source and it should be able to recode it. As Toolset custom post can also be set as queriable or not. How Toolset enables a custom post being queriable, it should be the same way. Is it possible to let me know?
Best regards,
Kelvin.
Toolset does this in the setting Toolset > Post Types > Additional Options.
How a post type is registered when using the WordPress API and PHP is shown here:
https://codex.wordpress.org/Post_Types
Toolset Types creates native WordPress Post Types.
The Post type you mention is not created by Toolset, but likely also registered with native WordPress API.
Hence, you might custom code a solution that will make it public, but you will probably go against the intentions of the author of that code.
It is, however, something that is not covered by Toolset Support, since the support here will help you with Toolset Plugins, not other plugins or custom code.
I'd suggest reaching out to the author of that Post type or plugin, asking them if it's a good idea to make the post type queriable, and if so, if they offer some internal API to do this, or what other suggestion they have for making their content publicly queryable
Note however that I was wrong, actually, we do allow to query (in Views) any kind of post type, even not publicly queriable ones, I just tested this.
It's the argument "'public' => false," in a Post Type's register, that makes it disappears from the Views.
Usually, you can use the WordPress API register_post_type_args() to change the $args of a Post Type.
https://developer.wordpress.org/reference/hooks/register_post_type_args/
But this is not related to Toolset - I cannot craft code for this.